Post by storm-cloud » Mon Apr 09, 2012 4:27 pm

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.

Attachments

Updated 10-05-2013

Last edited by storm-cloud on Sat May 11, 2013 2:29 pm, edited 11 times in total.

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by philbydevil » Thu Apr 12, 2012 12:22 pm

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>

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by storm-cloud » Thu Apr 12, 2012 2:30 pm

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.

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by philbydevil » Thu Apr 12, 2012 3:13 pm

;D

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

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by storm-cloud » Thu Apr 12, 2012 9:34 pm

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

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by philbydevil » Fri Apr 13, 2012 7:17 am

Yeah, I was surprised too. Maybe just an oversight...

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Laxman » Wed Jul 04, 2012 2:26 am

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.

Newbie

Posts

Joined
Fri Jun 29, 2012 7:00 am

Post by philbydevil » Wed Jul 04, 2012 9:35 am

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.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Signman » Tue Jul 10, 2012 4:41 am

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.

Newbie

Posts

Joined
Sun Jul 08, 2012 5:37 am

Post by philbydevil » Tue Jul 10, 2012 2:34 pm

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.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Signman » Wed Jul 11, 2012 1:40 pm

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?

Newbie

Posts

Joined
Sun Jul 08, 2012 5:37 am

Post by philbydevil » Thu Jul 12, 2012 11:58 am

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.

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by moignagr » Fri Jul 13, 2012 10:47 pm

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">

Attachments

VQMOD add state & post code to checkout for shipping & payment addresses opencart 1.5.3.1 fix


Newbie

Posts

Joined
Fri Jul 13, 2012 10:38 pm
Location - Jersey, Channel Islands, United Kingdom

Post by Signman » Sun Jul 15, 2012 4:02 am

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.

Newbie

Posts

Joined
Sun Jul 08, 2012 5:37 am

Post by ase618 » Sun Oct 07, 2012 9:31 am

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.

Attachments


artisantool.co
Don't forget to add [SOLVED] to your Thread Title (first post), if your issue is solved.


Active Member

Posts

Joined
Sun Jul 29, 2012 9:59 pm

Post by labeshops » Tue May 07, 2013 8:04 pm

The 1.5.3.1 fix above seems to be corrupted. Anyone know how to make this work on 1.5.2?

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by storm-cloud » Fri May 10, 2013 10:55 am

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 11:30 am, edited 1 time in total.

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by storm-cloud » Fri May 10, 2013 11:16 am

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.

Active Member

Posts

Joined
Wed Feb 22, 2012 8:07 am

Post by gibby » Tue Apr 08, 2014 9:46 pm

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

New member

Posts

Joined
Mon Jul 08, 2013 3:27 am

Post by Pete011 » Fri Apr 11, 2014 2:28 pm

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.

Newbie

Posts

Joined
Fri Apr 11, 2014 2:10 pm
Who is online

Users browsing this forum: No registered users and 19 guests