Page 1 of 2

[vQmod] Adds Company, State & Post Code to Checkout

Posted: Mon Apr 09, 2012 4:27 pm
by storm-cloud
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. ;D

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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Thu Apr 12, 2012 12:22 pm
by philbydevil
Great little mod, thanks!

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>

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Thu Apr 12, 2012 2:30 pm
by storm-cloud
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! :D

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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Thu Apr 12, 2012 3:13 pm
by philbydevil
;D

I'd been meaning to do this for ages so you saved me the effort!!

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Thu Apr 12, 2012 9:34 pm
by storm-cloud
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! :P

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Fri Apr 13, 2012 7:17 am
by philbydevil
Yeah, I was surprised too. Maybe just an oversight...

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Wed Jul 04, 2012 2:26 am
by Laxman
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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Wed Jul 04, 2012 9:35 am
by philbydevil
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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Tue Jul 10, 2012 4:41 am
by Signman
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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Tue Jul 10, 2012 2:34 pm
by philbydevil
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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Wed Jul 11, 2012 1:40 pm
by Signman
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?

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Thu Jul 12, 2012 11:58 am
by philbydevil
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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Fri Jul 13, 2012 10:47 pm
by moignagr
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 8)
<file name="catalog/view/theme/YOURTHEME/template/checkout/guest_shipping.tpl">

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Sun Jul 15, 2012 4:02 am
by Signman
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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Sun Oct 07, 2012 9:31 am
by ase618
Got it working on 1.5.3.1. Figured out that it was missing the zone.

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.

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Tue May 07, 2013 8:04 pm
by labeshops
The 1.5.3.1 fix above seems to be corrupted. Anyone know how to make this work on 1.5.2?

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Fri May 10, 2013 10:55 am
by storm-cloud
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. :)

Re: [vQmod] Adds State & Post Code to Checkout when Logged I

Posted: Fri May 10, 2013 11:16 am
by storm-cloud
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.

Re: [vQmod] Adds Company, State & Post Code to Checkout

Posted: Tue Apr 08, 2014 9:46 pm
by gibby
HI guys, Ive also got this issue on a new store we need to launch shortly.

Will this fix work for 1.5.6 and how exactly do I add to to the opencart files?

thanks

G

Re: [vQmod] Adds Company, State & Post Code to Checkout

Posted: Fri Apr 11, 2014 2:28 pm
by Pete011
gibby wrote:HI guys, Ive also got this issue on a new store we need to launch shortly.

Will this fix work for 1.5.6 and how exactly do I add to to the opencart files?

thanks

G
I am also using 1.5.6.1 version and the xml file posted by storm-cloud works fine (checkout-address-improved-v1.2.xml).

it is very simple:

1. Install VQMOD
2. upload the above file in the XML folder (in VQMOD directory)

Hope this helps.