• Hi Woocommerce team,

    I have a webshop with digital products (no physical delivery).

    Under Woocommerce/Settings/Sell to specific countries, I have enabled specific countries where I am selling to.
    However, ZIP code can be tricky in some countries and during the checkout my visitors have challenges writing the right format. If it is not the right format, the “Please enter a valid postcode” text appears.

    As there is no delivery of physical products, how can I remove/disable this validation?
    Is there a default configuration option for this?

    I can re-write the “Postal code” label to “Postal code (eg. 1170)” but it would be only an example for one country and of course it is not a nice solution for all countries.

    add_action( 'wp_footer', function () {
    if ( ! is_checkout() ) {
    return;
    }
    ?>
    <script>
    document.addEventListener('DOMContentLoaded', function () {
    const interval = setInterval(function () {
    const postcodeLabel = document.querySelector('label[for="billing-postcode"]');
    if (postcodeLabel) {
    postcodeLabel.textContent = 'Postal code (eg. 1170)';
    clearInterval(interval);
    }
    }, 300);
    });
    </script>
    <?php
    });

    Thank you in advance!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi @wpandlpuser!

    I understand that you’re selling digital products only and would like to disable the postcode validation at checkout, as some customers are having difficulty entering postcodes in the expected format for their country.

    WooCommerce does not currently provide a built-in setting to disable postcode validation while keeping the postcode field present on the checkout page. The validation is based on the customer’s selected country and is part of WooCommerce core functionality.

    However, you can achieve this by using custom code. If you need more in-depth support or want to consider professional assistance for customization, I can recommend WooExperts and Codeable.io as options for getting professional help. Alternatively, you can also ask your development questions in the  WooCommerce Community Slack as custom code falls outside our usual scope of support.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.