• Resolved tjos123

    (@tjos123)


    Hi. I referred to the following article to insert a default Billing and Shipping City.
    https://docs.woocommerce.com/document/change-the-default-state-and-country-on-the-checkout/

    This is my code.

    /**
     * Set default city on the checkout page
     */
    add_filter( 'default_checkout_billing_city', 'change_default_checkout_city' );
    add_filter( 'default_checkout_shipping_city', 'change_default_checkout_city' );
    
    function change_default_checkout_city() {
      return 'XX'; // city name
    }

    It works, however the Title of the field is still
    ‘Town / City (optional)’

    How can I make it Required and remove the text (optional) ?

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Billing and Shipping City’ is closed to new replies.