I am trying to make a zip code and postal code mandatory for shipping and billing information but i am not success kindly provide some solutions.
Default magento billing.phtml file already contains validation class validate-zip-international this is not working for you?– MufaddalMay 9, 2014 at 5:17
The magento default theme already supports this.– SukeshiniMay 9, 2014 at 5:21
Multiselect Box called ‘Postal Code is Optional for the following countries’.
Select the countries you want the field as optional.
As far as concerned with code changes, It is always recommended to follow inbuilt features instead of code changes.
1OP don't want to make field as optional– MufaddalMay 9, 2014 at 9:46
their will be a text box for the zip code their please add "required-entry" in the class attribute of the zipcode textbox.then it is done
<input type="text" title="<?php echo $this->__('Zip/Postal Code') ?>" name="billing[postcode]" id="billing:postcode" value="<?php echo $this->escapeHtml($this->getAddress()->getPostcode()) ?>" class="required-entry input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
see i had added required-entry in class above
The other way is to add
required-entry class name to the fields by visiting the templates.