[vQmod] Adds Company, State & Post Code to Checkout
18 posts
• Page 1 of 1
[vQmod] Adds Company, State & Post Code to Checkout
Just created a basic vQmod which adds the Company Name, Address Line 2 (only Address Line 1 in included by default), State/Region and Post Code to the registered address which is displayed to a customer during checkout when they are logged in.
This is a very basic mod but thought I would share it.
Please note that in Australia the postal guidelines state that the post code must come last. If you would like to change this to display the post code before the Country, just make the changes below within the vQmod (be mindful not to include additional spacing).
Change all instances of:
To:
Update (10/05/2013): Added in field for Company Name and also improved formatting (via PHP if statements). Also added in version tolerance for newer versions of OpenCart.
This is a very basic mod but thought I would share it.

Please note that in Australia the postal guidelines state that the post code must come last. If you would like to change this to display the post code before the Country, just make the changes below within the vQmod (be mindful not to include additional spacing).
Change all instances of:
- Code: Select all
<?php echo $address['country']; ?> <?php echo $address['postcode']; ?>
To:
- Code: Select all
<?php echo $address['postcode']; ?> <?php echo $address['country']; ?>
Update (10/05/2013): Added in field for Company Name and also improved formatting (via PHP if statements). Also added in version tolerance for newer versions of OpenCart.
- Attachments
-
checkout-address-improved-v1.2.xml- Updated 10-05-2013
- (5.86 KiB) Downloaded 9 times
Last edited by storm-cloud on Sat May 11, 2013 6:29 am, edited 11 times in total.
- storm-cloud
- Posts: 156
- Joined: Wed Feb 22, 2012 12:07 am
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Great little mod, thanks!
But you need this as well, for instances where customers have multiple addresses on file:
But you need this as well, for instances where customers have multiple addresses on file:
- Code: Select all
<operation error="log">
<search position="replace"><![CDATA[
<option value="<?php echo $address['address_id']; ?>"><?php echo $address['firstname']; ?> <?php echo $address['lastname']; ?>, <?php echo $address['address_1']; ?>, <?php echo $address['city']; ?>, <?php echo $address['country']; ?></option>
]]></search>
<add><![CDATA[
<option value="<?php echo $address['address_id']; ?>"><?php echo $address['firstname']; ?> <?php echo $address['lastname']; ?>, <?php echo $address['address_1']; ?>, <?php echo $address['city']; ?>, <?php echo $address['zone']; ?>, <?php echo $address['country']; ?>, <?php echo $address['postcode']; ?></option>
]]></add>
</operation>
-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
philbydevil wrote:Great little mod, thanks!
But you need this as well, for instances where customers have multiple addresses on file:
Yes, of course. Thank you!

I knocked this up in less than a minute (as you can see by how simple the mod is) as I just wanted to show the Post Code during checkout. Please excuse my oversight. I have updated the file and uploaded again.
- storm-cloud
- Posts: 156
- Joined: Wed Feb 22, 2012 12:07 am
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
I'd been meaning to do this for ages so you saved me the effort!!
-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
I am truly surprised that this is not a standard implementation though.
As far as I am aware, everywhere in the World makes use of Post Codes, and those that don't would probably be out hunting or rubbing sticks together instead of doing some online shopping!
As far as I am aware, everywhere in the World makes use of Post Codes, and those that don't would probably be out hunting or rubbing sticks together instead of doing some online shopping!

- storm-cloud
- Posts: 156
- Joined: Wed Feb 22, 2012 12:07 am
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Yeah, I was surprised too. Maybe just an oversight...
-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
This is not working for me. maybe not compatible with the latest vqmod or v1.5.3.1? This is definitely a hole without it.
- Laxman
- Posts: 7
- Joined: Thu Jun 28, 2012 11:00 pm
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Probably not compatible with 1.5.3.1...
Look in your vqmod error log and see which line of code isn't getting picked up. Probably just a small change in the core file/s that will need to be updated in the xml.
Look in your vqmod error log and see which line of code isn't getting picked up. Probably just a small change in the core file/s that will need to be updated in the xml.
-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Same issue I have been searching to fix this problem all over. I tried the recommended vqmod, but with no results. I am also running version 1.5.3.1.
- Signman
- Posts: 8
- Joined: Sat Jul 07, 2012 9:37 pm
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Signman wrote:Same issue I have been searching to fix this problem all over. I tried the recommended vqmod, but with no results. I am also running version 1.5.3.1.
Same issue = same answer. Check the vqmod error log and find the missing lines of code.
-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Same issue = same answer. Check the vqmod error log and find the missing lines of code.
I have no vqmod code errors assuming I'm looking in the right place. system>error logs
what next?
- Signman
- Posts: 8
- Joined: Sat Jul 07, 2012 9:37 pm
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Wrong spot. You'll need to go to your vqmod folder and find the error log there. It can't be accessed from Admin unless you have installed vQmod Manager.
-

philbydevil - Posts: 828
- Joined: Thu Dec 02, 2010 9:20 pm
- Location: Sunshine Coast, Australia
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Naming convention is different for 1.5.3.1
Fix is attached for shipping & payment addresses.
Upload the two files in the attached zip to your /vqmod/xml directory
Also!!!
Change to YOUR template name on line 8 in BOTH files
I use Shoppica2 as an example.
<file name="catalog/view/theme/shoppica2/template/checkout/shipping_address.tpl">
Havent checked if guest checkout has same problem.
Just do the same, make a new xml file, change line 8 to your template name and point to guest_shipping.php
EXAMPLE: (line
<file name="catalog/view/theme/YOURTHEME/template/checkout/guest_shipping.tpl">
Fix is attached for shipping & payment addresses.
Upload the two files in the attached zip to your /vqmod/xml directory
Also!!!
Change to YOUR template name on line 8 in BOTH files
I use Shoppica2 as an example.
<file name="catalog/view/theme/shoppica2/template/checkout/shipping_address.tpl">
Havent checked if guest checkout has same problem.
Just do the same, make a new xml file, change line 8 to your template name and point to guest_shipping.php
EXAMPLE: (line

<file name="catalog/view/theme/YOURTHEME/template/checkout/guest_shipping.tpl">
- Attachments
-
1.5.3.1-fix.zip- VQMOD add state & post code to checkout for shipping & payment addresses opencart 1.5.3.1 fix
- (1.27 KiB) Downloaded 59 times
- moignagr
- Posts: 2
- Joined: Fri Jul 13, 2012 2:38 pm
- Location: Jersey, Channel Islands, United Kingdom
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Ok, still no change for me. 1.5.3.1
I used the attach files. changed the template name to default because I am using the default template.
<file name="catalog/view/theme/default/template/checkout/payment_address.tpl">
I did the same for other shipping_address.tpl xml file.
Loaded them to the vqmod xml folder. tried it> no change. Deleted the vqmod cache> no change. Cleared Browser cache> no change.
Any ideas?
When my customers are checking out the zip code (post code) does not show during step 2-3 of the checkout process. thanks for all the help.
I used the attach files. changed the template name to default because I am using the default template.
<file name="catalog/view/theme/default/template/checkout/payment_address.tpl">
I did the same for other shipping_address.tpl xml file.
Loaded them to the vqmod xml folder. tried it> no change. Deleted the vqmod cache> no change. Cleared Browser cache> no change.
Any ideas?
When my customers are checking out the zip code (post code) does not show during step 2-3 of the checkout process. thanks for all the help.
- Signman
- Posts: 8
- Joined: Sat Jul 07, 2012 9:37 pm
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
Got it working on 1.5.3.1. Figured out that it was missing the zone.
Line 12
Should be:
I also moved the post code to display before the country so it would look correct for USA.
Changed Line 16:
To:
Here are the modified vQmod's.
Line 12
- Code: Select all
<option value="<?php echo $address['address_id']; ?>" selected="selected"><?php echo $address['firstname']; ?> <?php echo $address['lastname']; ?>, <?php echo $address['address_1']; ?>, <?php echo $address['city']; ?>, <?php echo $address['zone']; ?>, <?php echo $address['country']; ?></option>
Should be:
- Code: Select all
<option value="<?php echo $address['address_id']; ?>" selected="selected"><?php echo $address['firstname']; ?> <?php echo $address['lastname']; ?>, <?php echo $address['address_1']; ?>, <?php echo $address['city']; ?>, <?php echo $address['zone']; ?>, <?php echo $address['country']; ?></option>
I also moved the post code to display before the country so it would look correct for USA.
Changed Line 16:
- Code: Select all
<option value="<?php echo $address['address_id']; ?>" selected="selected"><?php echo $address['firstname']; ?> <?php echo $address['lastname']; ?>, <?php echo $address['address_1']; ?>, <?php echo $address['city']; ?>, <?php echo $address['zone']; ?>, <?php echo $address['country']; ?>, <?php echo $address['postcode']; ?></option>
To:
- Code: Select all
<option value="<?php echo $address['address_id']; ?>" selected="selected"><?php echo $address['firstname']; ?> <?php echo $address['lastname']; ?>, <?php echo $address['address_1']; ?>, <?php echo $address['city']; ?>, <?php echo $address['zone']; ?>, <?php echo $address['postcode']; ?>, <?php echo $address['country']; ?></option>
Here are the modified vQmod's.
- Attachments
-
1.5.3.1-fix-modified.zip- (6.62 KiB) Downloaded 46 times
artisantool.co
Don't forget to add [SOLVED] to your Thread Title (first post), if your issue is solved.
Don't forget to add [SOLVED] to your Thread Title (first post), if your issue is solved.
- ase618
- Posts: 78
- Joined: Sun Jul 29, 2012 1:59 pm
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
The 1.5.3.1 fix above seems to be corrupted. Anyone know how to make this work on 1.5.2?
Running Opencart v1.5.2.2 with multi-stores from http://www.labeshops.com including Sexy Clothing, Lingerie & Shoes, Adult Halloween Costumes Gothic Jewelry, Clothing, Shoes Spiritual Supplies for all Paths, Sterling Silver Jewelry & more and Egyptian God Statues = Hosted by Midphase
- labeshops
- Posts: 2081
- Joined: Wed Aug 03, 2011 8:41 pm
- Location: Florida, USA
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
ase618 wrote:Got it working on 1.5.3.1. Figured out that it was missing the zone.
Where is the missing zone? This was included in the original vQmod.
ase618 wrote:I also moved the post code to display before the country so it would look correct for USA.
Yes, in Australia the postal guidelines state that the post code should be last.

Last edited by storm-cloud on Fri May 10, 2013 3:30 am, edited 1 time in total.
- storm-cloud
- Posts: 156
- Joined: Wed Feb 22, 2012 12:07 am
Re: [vQmod] Adds State & Post Code to Checkout when Logged I
I have just uploaded a newer version in the original post. I have added another field for Company Name and Address Line 2. I have also included version tolerance for newer versions of OpenCart.
Please let me know if there are any issues and I will address these with another update.
Please let me know if there are any issues and I will address these with another update.
- storm-cloud
- Posts: 156
- Joined: Wed Feb 22, 2012 12:07 am
18 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests


cmd-f, cmd-c, cmd-v, cmd-z + vQmod.










