Since Reciever Contact number is IMPORTANT, i wanted to add a new field in the Shipping address.
notice: there is a field called Telephone, but thats for the costumer only and thats attached to his.her information NOT the shipping information.
why do Reciecer Contact No. is important for me?
well, most customers they order gift for family and friends, so i need the customer info ofcourse AND the reciever shipping address. since there is no field for reciever contact no. then lets do it togather.
first of all. i am trying a mothed i read here some where about duplicating a costumer field. so i am trying to do that to shipping fiels.
i will name the new fiels contactno (Reciever Contact Number)
these are the files we going to edet:
catalog folder
catalog\view\theme\default*\template\checkout\address.tpl
catalog\view\theme\default*\template\checkout\guest_step_1.tpl
catalog\view\theme\default*\template\account\address.tpl
catalog\controller\checkout\address.php
catalog\controller\checkout\guest_step_1.php
catalog\controller\checkout\guest_step_2.php
catalog\controller\checkout\shipping.php
catalog\controller\checkout\payment.php
catalog\controller\checkout\confirm.php
catalog\controller\account\address.php
catalog\model\account\address.php
catalog\model\account\order.php
catalog\model\checkout\order.php
catalog\language\english\checkout\address.php
catalog\language\english\checkout\guest_step_1.php
catalog\language\english\account\address.php
Admin Folder
admin\view\theme\default*\template\sale\order_form.tpl
admin\view\theme\default*\template\sale\cutomer_form.tpl
admin\language\english\sale\order.php
admin\model\sale\order.php
admin\controller\sale\order.php
now which field i will follow and duplicate to create my new contractno field?
i decided to duplicate the lastname field.
so for each time i fine lastname, i will duplicate it's line(s) and change the lastname to contactno.
EX:-
i found this:
Code: Select all
$this->session->data['guest']['lastname'] = $this->request->post['lastname'];
Code: Select all
$this->session->data['guest']['contactno'] = $this->request->post['contactno'];
(BACK UP YOUR FILES )
open each file and select the Find option to find the lastnamefield.
now do the changes for the rest of the files.
HAVE FUN
database alter:-
ofcourse we have to add the new contactno to the database.
run this in the database (using phpMyAdmin or any if you like)
Code: Select all
ALTER TABLE store_order ADD shipping_contactno varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '';
ALTER TABLE store_order ADD payment_contactno varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '';
Code: Select all
ALTER TABLE store_order ADD contactno varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '';
i know there are soME editS i have to do in admin files.
I will APPRECIATE if anyone knows, which files do we need to edit in the admin folder?
thanks
EDIT: Thanks, i did it by myself. now its working like how it should.
i didnt know that i have to do ALL this edit just to add a simple field.
there should be a way for OC programmer to implement a way in the core to allow the admin to add all kind of field to the store.
ex: able to create/select fields from the admin back-end what field a customer should fill in the front-end.
ex2: able to create/select fields from the admin back-end what field a customer should fill for shipping info.
ex3: able to create/select options from the admin back-end what options a customer would see in the productpage, checkout process pages and any page on the way until before the pament page.
Thats Only IMVHO