• Resolved iamwpuser

    (@iamwpuser)


    Hello, esteemed WooCommerce community!

    I’ve encountered a task that seemed quite straightforward at first glance, but all attempts to find a solution have been fruitless. My goal is to make the “City” field optional on the checkout page to simplify the process for my customers. Here are the steps I’ve already taken:

    1. Tried using the woocommerce_checkout_fields hook to change the required attribute of the city field to false.
    2. Used the woocommerce_default_address_fields hook with the same goal, attempting to change the mandatory nature of the “City” field at the level of all address fields.
    3. Attempted to dynamically manage the required attribute of the “City” field using JavaScript depending on the selected shipping method.
    4. Checked the source code of the page and WooCommerce settings to ensure there were no other reasons why the field remained mandatory.
    5. Also considered the possibility of a theme conflict or server caching by conducting tests on a clean WordPress installation with the Storefront theme and no active plugins except WooCommerce.

    Unfortunately, despite all efforts, the “City” field still remains mandatory, and orders cannot be placed without filling it in.

    P.S. I have also tried installing 3 or 4 of the most popular plugins for this purpose, and the disabling of the mandatory field does not work in them either.

    I would be very grateful for any suggestions, advice, or directions for further actions. Perhaps some of you have faced a similar problem or know which method would be effective in this situation.

    Thank you in advance for your time and help!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unable to Make the “City” Field Optional at WooCommerce Checkout’ is closed to new replies.