• Resolved e dev

    (@efishinsea)


    I have all city/state/address/zip fields disabled and set to “not required” for both shipping and billing.

    https://snipboard.io/QnYriw.jpg

    On trying to checkout, I still get “Please enter an address to continue.” even though the fields aren’t there and I am unable to checkout.

    Also, I’ve added 2 custom select fields that have a default placeholder set, but it doesn’t show up in the select dropdown.
    https://snipboard.io/TOICbF.jpg

    • This topic was modified 4 months ago by e dev.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter e dev

    (@efishinsea)

    Curiously, if I add this code to my Functions file, it works.

    // remove Billing Country
    add_filter( 'cfw_get_billing_checkout_fields', 'remove_checkout_fields', 100 );
    function remove_checkout_fields( $fields ) {
    unset( $fields['billing_country'] );
    return $fields;
    }

    // Set billing Country field to not required
    add_filter( 'woocommerce_checkout_fields', 'unrequire_checkout_fields' );
    function unrequire_checkout_fields( $fields ) {
    $fields['billing']['billing_country']['required'] = false;
    return $fields;
    }

    …but I thought that was what this plugin was supposed to do.

    Obviously, it is used by many so there must be something else with the store I am working on that is causing this.

    Plugin Support Dina S.

    (@themehighsupport)

    Hi,

    Let me address your questions one by one.

    >> On trying to checkout, I still get “Please enter an address to continue.” even though the fields aren’t there and I am unable to checkout.

    The issue is occurring due to disabling/ removal of the?billing_country/shipping_country?field. Please be informed that when you provide validation for the state field or zip code field in any section, it is mandatory to have an active country field. You can resolve this issue by enabling the?billing_country/shipping_country?field.
    ?
    Please note that you can always hide the country field if you don’t feel like displaying it. For this, you can give the field type of the country field as hidden (Hidden?field type), with a country code (for example, ‘GB‘ for the United Kingdom) provided as the default value.
    ?
    Further, if you are selling your products only to few countries and you don’t want to let the customer select other countries from the checkout page. Instead of deleting the default country field, you can achieve your requirement by navigating to?WooCommerce>>Settings>>General>>General options>>Selling location(s), select the option?Sell to specific countries?and select the Countries as per your requirement.?

    Also, please ensure that you have enabled the option “Enable required validation override for address fields.” in the?Locale override settings?inside the?Advanced Settings?tab.

    >> Also, I’ve added 2 custom select fields that have a default placeholder set, but it doesn’t show up in the select dropdown.

    In order to show the placeholder, please provide a blank option on the top of the select field.

    Thank you!

    Thread Starter e dev

    (@efishinsea)

    oddly, I have no address fields enabled and do have the Enable required validation override for address fields option checked. I still have the code in my functions file to add and un-require the country fields, so I think that is allowing checkout. This is the same as disabling them in your plugin too I would imagine.

    I also did some testing and have toggled the WPEngine “Edge Full Page Cache” a few times seems to have corrected the checkout issue, but I will keep testing.

    Thanks.

    • This reply was modified 3 months, 4 weeks ago by e dev.
    Plugin Support Dina S.

    (@themehighsupport)

    Your issue needs a detailed check. Can you please raise a ticket through our website? We hope our technical team will be able to help you.

    Thank you!

    Plugin Support Dina S.

    (@themehighsupport)

    @efishinsea

    Thank you for sharing the solution you found.

    If the error happens again, please don’t hesitate to reach out.

    For now, we’ll consider this case closed.

    Wishing you a great day ahead!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.