Post by radact » Mon Jun 19, 2023 10:30 am

Is there an option make the Postcode a mandatory field in when a new customer is created like some of the other fields?

I can see in the below files that it should be a required field, but why does OC still let the customer complete the form and save it without the Postcode field completed? Or is there a different template somewhere for new accounts?

"catalog/view/theme/default/template/account/address_form.tpl"
"catalog/view/theme/default/template/account/register.tpl"

Code: Select all

          <div class="form-group required">
            <label class="col-sm-2 control-label" for="input-postcode"><?php echo $entry_postcode; ?></label>
            <div class="col-sm-10">
              <input type="text" name="postcode" value="<?php echo $postcode; ?>" placeholder="<?php echo $entry_postcode; ?>" id="input-postcode" class="form-control" />
              <?php if ($error_postcode) { ?>
              <div class="text-danger"><?php echo $error_postcode; ?></div>
              <?php } ?>
            </div>
          </div>
I have a postage calculator that needs the postcode to calculate the correct postage fee at the checkout and without it, it only displays the Pickup From Store option.

Using OC2.3.0.2

Thanks!
Last edited by radact on Tue Jun 20, 2023 7:19 am, edited 1 time in total.

New member

Posts

Joined
Fri Nov 25, 2016 11:36 am

Post by ADD Creative » Mon Jun 19, 2023 6:04 pm

It's an individual setting for each country, as not all countries use postcodes. Go to System -> Localisation -> Countries and edit the countries you ship to. There should be a Postcode Required option.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by radact » Mon Jun 19, 2023 7:03 pm

Fantastic, there is a Postcode Required checkbox that needed to be ticked for Australia.

Thank-you!

New member

Posts

Joined
Fri Nov 25, 2016 11:36 am

Post by paulfeakins » Mon Jun 19, 2023 9:45 pm

radact wrote:
Mon Jun 19, 2023 7:03 pm
Fantastic, there is a Postcode Required checkbox that needed to be ticked for Australia.
Great, please now add [SOLVED] to the start of the post 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: Baidu [Spider] and 14 guests