Post by wychegnome » Sat Mar 30, 2024 12:43 am

Currently the checkout process at Steps 2 (Billing) and 3 (Delivery) does not include the customer's postcode in the address as displayed.
How can I add this to the address information displayed please.
Open Cart version 3.0.3.2

Thanks, John

New member

Posts

Joined
Mon Jan 05, 2015 12:01 am

Post by Johnathan » Sat Mar 30, 2024 10:25 pm

If you're using the default OpenCart checkout, try this edit:

Code: Select all

IN:
/catalog/view/theme/default/template/checkout/payment_address.twig
and
/catalog/view/theme/default/template/checkout/shipping_address.twig

REPLACE BOTH INSTANCES OF:
{{ address.zone }}, {{ address.country }}</option>

WITH:
{{ address.zone }}, {{ address.postcode }}, {{ address.country }}</option>

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by wychegnome » Mon Apr 01, 2024 2:46 am

I have followed the advice from Jonathan, thank you for this, but for some reason it doesn't produce the results although logic says it should.
In both lines in both payment_address.twg and shipping_address.twg the field names now read:
{{ address.firstname }} {{ address.lastname }}, {{ address.address_1 }}, {{ address.address_2 }}, {{ address.city }}, {{ address.zone }}, {{ address.postcode }}, {{ address.country }}
However, the system only shows firstname, lastname, address_1, city, country to the person checking out. (there is probably nothing to display in zone)
Is there somewhere else that needs tweaking or changing to implement the change?
Thanks, John

New member

Posts

Joined
Mon Jan 05, 2015 12:01 am

Post by Johnathan » Mon Apr 01, 2024 9:26 pm

Try to refresh your ocMod cache in Extensions > Modifications, and any other caching extensions you have. You may also need to clear the theme cache, which you can do using the gear icon in the upper-right of the main admin Dashboard page.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by JNeuhoff » Mon Apr 01, 2024 10:00 pm

You are not telling us the whole story here. In a standard OC 3.0.3.2 the post code is already included the the checkout/payment_address.twig and checkout/shipping_address.twig, as follows:

Code: Select all

    <div class="form-group required">
      <label class="col-sm-2 control-label" for="input-payment-postcode">{{ entry_postcode }}</label>
      <div class="col-sm-10">
        <input type="text" name="postcode" value="" placeholder="{{ entry_postcode }}" id="input-payment-postcode" class="form-control" />
      </div>
    </div>

Code: Select all

    <div class="form-group required">
      <label class="col-sm-2 control-label" for="input-shipping-postcode">{{ entry_postcode }}</label>
      <div class="col-sm-10">
        <input type="text" name="postcode" value="{{ postcode }}" placeholder="{{ entry_postcode }}" id="input-shipping-postcode" class="form-control" />
      </div>
    </div>
You have most likely got a 3rd party modification, or a con-compliant 3rd party theme, causing this issue.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by wychegnome » Tue Apr 02, 2024 6:45 pm

Thank you to both Johnathan and JNeuhoff for responding and helping.

I have now refreshed both the ocMod and the template caches and this has solved the problem. All the required address information now appears.

Just to confirm, I am using the default theme that comes with the system and not one from any other source. Although I do have a small number of modifications installed (all obtained via the Marketplace) these do not interfere with showing the addresses at checkout.

The form-group codes suggested would seem to relate to entry of the address by the customer. However, the relevant fields had already been filled in but wouldn't show during the checkout process.

Thank you both, John

New member

Posts

Joined
Mon Jan 05, 2015 12:01 am

Post by Johnathan » Tue Apr 02, 2024 10:21 pm

JNeuhoff wrote:
Mon Apr 01, 2024 10:00 pm
You are not telling us the whole story here. In a standard OC 3.0.3.2 the post code is already included the the checkout/payment_address.twig and checkout/shipping_address.twig,
wychegnome meant that the postcode doesn't show up in the address selector for saved addresses. So adding a new address shows it, but if you're selecting a saved address, in the default checkout it won't show the postcode for the saved address.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by MCE Digital » Wed Apr 03, 2024 4:26 pm

This is a known problem as Jonathan points out. It also varies by country which fields and in what order they should be shown. Usually for Dutch shops, address_2 should be added. For example, for Belgian shops, firstname and lastname are often reversed.
Perhaps a nice addition for the future is to automatically use the set address format in country settings for this selector.

Newbie

Posts

Joined
Thu Nov 29, 2018 10:32 pm

Post by paulfeakins » Thu Apr 04, 2024 10:40 pm

wychegnome wrote:
Tue Apr 02, 2024 6:45 pm
I have now refreshed both the ocMod and the template caches and this has solved the problem. All the required address information now appears.
Excellent! Now please add [SOLVED] to the start of this topic title.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 18 guests