Community Forums

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

Put any free vQmod scripts here.
vQmod details

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

Postby storm-cloud » Mon Apr 09, 2012 8:27 am

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

Postby philbydevil » Thu Apr 12, 2012 4:22 am

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 Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
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

Postby storm-cloud » Thu Apr 12, 2012 6:30 am

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.
storm-cloud
 
Posts: 156
Joined: Wed Feb 22, 2012 12:07 am

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

Postby philbydevil » Thu Apr 12, 2012 7:13 am

;D

I'd been meaning to do this for ages so you saved me the effort!!
I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
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

Postby storm-cloud » Thu Apr 12, 2012 1: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
storm-cloud
 
Posts: 156
Joined: Wed Feb 22, 2012 12:07 am

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

Postby philbydevil » Thu Apr 12, 2012 11:17 pm

Yeah, I was surprised too. Maybe just an oversight...
I Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
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

Postby Laxman » Tue Jul 03, 2012 6:26 pm

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

Postby philbydevil » Wed Jul 04, 2012 1: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 Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
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

Postby Signman » Mon Jul 09, 2012 8:41 pm

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

Postby philbydevil » Tue Jul 10, 2012 6:34 am

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 Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
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

Postby Signman » Wed Jul 11, 2012 5:40 am

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

Postby philbydevil » Thu Jul 12, 2012 3: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 Image cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
User avatar
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

Postby moignagr » Fri Jul 13, 2012 2: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
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

Postby Signman » Sat Jul 14, 2012 8:02 pm

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.
Signman
 
Posts: 8
Joined: Sat Jul 07, 2012 9:37 pm

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

Postby ase618 » Sun Oct 07, 2012 1: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
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.
ase618
 
Posts: 78
Joined: Sun Jul 29, 2012 1:59 pm

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

Postby labeshops » Tue May 07, 2013 12:04 pm

The 1.5.3.1 fix above seems to be corrupted. Anyone know how to make this work on 1.5.2?
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

Postby storm-cloud » Fri May 10, 2013 2: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 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

Postby storm-cloud » Fri May 10, 2013 3: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.
storm-cloud
 
Posts: 156
Joined: Wed Feb 22, 2012 12:07 am


Return to vQmods

Who is online

Users browsing this forum: dereklro and 8 guests

Hosted by Arvixe Web Hosting