Page 1 of 1

[SOLVED] Force Postcode for New User/Checkout

Posted: Mon Jun 19, 2023 10:30 am
by radact
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!

Re: Force Postcode for New User/Checkout

Posted: Mon Jun 19, 2023 6:04 pm
by ADD Creative
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.

Re: Force Postcode for New User/Checkout

Posted: Mon Jun 19, 2023 7:03 pm
by radact
Fantastic, there is a Postcode Required checkbox that needed to be ticked for Australia.

Thank-you!

Re: Force Postcode for New User/Checkout

Posted: Mon Jun 19, 2023 9:45 pm
by paulfeakins
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.