Remove autofill on the checkout form for the State

This topic has 2 replies, 2 voices, and was last updated 7 months ago ago by Tony Rodriguez

  • Avatar: yuvi
    yuvi
    Participant
    September 25, 2023 at 08:34

    There is an autofill on the checkout form for the State and it says – California and it is causing some issues. I want to leave the State field blank for the customer to fill.

    Some customers are receiving order confirmations that have the wrong state, California.

    “California” is auto defaulted in the State field on the checkout page. How can i make it blank?

    Please, contact administrator
    for this information.
    1 Answer
    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff
    September 25, 2023 at 09:46

    Hello, @yuvi,

    Thank you for using our theme and for contacting us.

    If you desire to disable the autofill feature on the checkout form for the ‘State’ field, kindly follow the steps below:

    1. Navigate to XStore on your dashboard.
    2. Click on ‘Theme Options’.
    3. Proceed to ‘Woocommerce’.
    4. Select ‘Cart/checkout layout’.
    5. Turn off the ‘Advanced Cart/Checkout Layout’ option.
    6. Click ‘Publish’ to save the changes.

    After that, Please follow the steps below:

    1. Navigate to your WordPress Dashboard.
    2. Click on ‘Appearance’.
    3. Select ‘Themes’.
    4. Choose ‘Xstore Child Theme’.
    5. Open the ‘Function.php’ file.
    6. Copy and paste the provided code into the ‘Function.php’ file.
    7. Update the file to save the changes.

    add_filter('default_checkout_billing_state', 'remove_default_billing_state');
    add_filter('default_checkout_shipping_state', 'remove_default_shipping_state');
    function remove_default_billing_state() {
        return '';
    }
    function remove_default_shipping_state() {
        return '';
    }

    Kindly add the new product to your cart once again. Please ensure to clear your browser cache before revisiting your site.

    Please refer to the attached images for your reference.
    https://imgur.com/J1fqz8X

    https://imgur.com/xcEbIBE

    Note: Please note that you should take a complete backup of your site before proceeding.

    We trust that this solution will effectively address your concern.

    Should you have any further questions or concerns, please do not hesitate to contact us.

    Best Regards,
    8Theme’s Team.

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.