[SOLVED] Force Postcode for New User/Checkout
Posted: 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"
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!
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>
Using OC2.3.0.2
Thanks!