On my theme, the customer is allowed to proceed to the payment page of the checkout without having to add a Postcode, despite it being set as required. The other fields (Street, City) are required and validate correctly when they're left empty (the user is prevented from proceeding to the next step).

Any ideas why this is the case?

  • The Js form doesn't validate? Commented Jan 5, 2017 at 17:09
  • Correct. The 'This is a required field.' doesn't appear and just allows the user to proceed
    – Mitch7663
    Commented Jan 5, 2017 at 17:18
  • How about your issue? Commented Jan 10, 2017 at 15:43
  • No, neither option worked :-(
    – Mitch7663
    Commented Jan 15, 2017 at 22:33

2 Answers 2


On the checkout page, by default, the Postal Code are required field.


<item name="postcode" xsi:type="array">
    <!-- post-code field has custom UI component -->
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
    <item name="validation" xsi:type="array">
        <item name="required-entry" xsi:type="string">true</item>

enter image description here

So, you should check this field in your custom layout. Make sure the Required validation is enabled.

Additionally, if you want to make this attribute to be required on the server side also, you can use a simple query to :

UPDATE eav_attribute a SET a.`is_required` = 1 WHERE a.`attribute_code` = 'postcode';
  • I'm aware. But mine isn't.
    – Mitch7663
    Commented Jan 7, 2017 at 8:41
  • Your custom theme has this field? Commented Jan 7, 2017 at 8:43
  • We have Luma theme in use and it is not validating ZIP and let's all ZIP's through. Just a warning. That checkout_index_index.xml is not present in Luma.
    – Webninja
    Commented Aug 16, 2017 at 18:09
  • In Magento 2 we can specify the Zip/Postal Code is Optional for countries.

  • In Magento admin Go to Stores > Configuration >General > General

  • for "Zip/Postal Code is Optional for" = Select countries for which you want to zip code option

  • Save
  • Flush cache

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.