Hi @leoce
There was a change in February which takes the rules for block checkout address fields from the locale. WooCommerce maintains a list of country locales with the differences in required address fields, often including postal codes and state fields, which commonly differ between countries.
The Cart and Checkout Blocks now use those definitions to configure the address fields, including whether postcode is optional or not for a given country.
I notice your site seems to be based in Romania – to make the postcode optional there, you can try this snippet, which applies a filter to the function that generates the country locale list:
add_filter('woocommerce_get_country_locale', function($locales) {
$locales['RO']['postcode']['required'] = false;
return $locales;
});
I hope this helps. Please note that if you need to make postcode optional for other countries as well, you’d need to modify the snippet to make it apply to them.
Still under development
I just want to note that it’s important to remember that extensibility and customizations on the Cart and Checkout Blocks are still under development, and represent the bleeding edge, so if you find you can’t customize them correctly for your needs, these blocks may not yet be suitable for your use.
In particular, extensions that use hooks related to cart and checkout may not function as expected. Extensions that render additional markup in cart or checkout – for example, custom checkout fields – are not supported.
The page I linked above will be updated as development continues on the blocks, or you can follow development more closely on GitHub.
-
This reply was modified 3 years, 5 months ago by
josha8c. Reason: formatting