• Resolved lizeshakya

    (@lizeshakya)


    Hi everyone,

    I am currently using Checkout Block for WordPress WooCommerce. Can you please guide me on how to add the default value when the customer visits to the checkout page?

    So far, in my child theme, I have implemented using filter

    add_filter( 'woocommerce_checkout_fields' , 'custom_override_postcode_value' );

    function custom_override_postcode_value( $fields ) {
    $fields['shipping']['shipping_postcode']['default'] = '4000';
    return $fields;
    }

    Similarly, I have tried with hooks: woocommerce_store_api_customer. But nothing worked.

    There is an option in WooCommerce > Settings to set the default customer location. But it only allowed to set as Shop country / region, which is not the desired result.

    Is there any way to set the default shipping postcode to 4000?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Checkout Block How to Override Value (PostCode)’ is closed to new replies.