Post by Maansy » Thu Jul 08, 2010 10:12 pm

hi all, i want to share this with everyone knowing there are some might find this helpful.

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']; 
add this below it:

Code: Select all

$this->session->data['guest']['contactno'] = $this->request->post['contactno']; 
time for the EDIT:-

(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 '';
I also created this one for testting (dont have to do this step)

Code: Select all

ALTER TABLE store_order ADD contactno varchar(32) COLLATE utf8_bin NOT NULL DEFAULT ''; 
until here i stopped to check my work.


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
Last edited by Maansy on Fri Jul 09, 2010 9:51 pm, edited 11 times in total.

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by fido-x » Thu Jul 08, 2010 10:27 pm

Maansy wrote:... 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.
If customers are buying gifts for family and friends, surely it is up to the customer to notify the family member or friend. Do you want to spoil the surprise? Your customers wouldn't be too happy with you if you did! From your perspective as the store owner, customer and receiver are one and the same.

Image
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool

If you're not living on the edge ... you're taking up too much space!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by Maansy » Thu Jul 08, 2010 10:33 pm

you are right in a way, but i was refering to my store not all store and having the reciever's contact no is not for spoiling surprises. i need it becuase its required for shipping.
if you are sending a gift to a family member, wouldnt a shipping compant take the shipping info + the contact no. of the reciever for just incase they couldnt find the exact location or for any other reasons.
in my case, i will be selling flowers, chocolates and gifts.
i need to have the reciever's contact no. (for the just in case situation)
i need it for almost all orders going to work location, hospitals, schools ..etc

incase a customer noted out that its a surprise gift, then we will shhhhhhhhhhh about it, but still need the reciever's contact no.
i hope i made it clear :)

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by Maansy » Fri Jul 09, 2010 8:52 am

you guys can move this to HOW-TO section if you see this is helpful.
thanks

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by IT_MAN » Wed May 08, 2013 11:12 am

how to make it work in v. 1.5.4? Thanks.

and if you can elaborate it more in detail, especially in editing .tpl files. Thanks again.

New member

Posts

Joined
Tue Apr 23, 2013 11:18 am

Post by applesmiles » Fri Nov 08, 2013 6:54 pm

IT_MAN wrote:how to make it work in v. 1.5.4? Thanks.

and if you can elaborate it more in detail, especially in editing .tpl files. Thanks again.
yea, anyone can share how to do it in 1.5.4? files seem different, appear to have more files to edit...it seems.

Newbie

Posts

Joined
Mon May 20, 2013 5:45 pm
Who is online

Users browsing this forum: No registered users and 57 guests