Support » Plugin: WooCommerce » Predefined Country in Cart and Checkout Page

  • Resolved Adapta

    (@adaptaonline)


    Good morning,

    I would like to know how can I solve a problem. I have a woocommerce site selling just for brazilian customers. So, I have just one country: Brasil. But, when my customer adds some products to the catalog, the field “Country” keeps showing nothing, and, then, the customer has to select the country instead the predefined “blank” option.

    I would like to know: HOW CAN I CHANGE THE CART PREDEFINED COUNTRY. Now I have a list, starting with “blank” and I want to start the list with “Brasil” or just dont have a list and only my unique option.

    Any help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Stef

    (@serafinnyc)

    In settings make sure you are setting the Selling Location and Shipping Location to Brasil and nothing else. That should only show Brasil Now.

    Do you want to simply remove the Country all together?

    If so you can add this. For Billing only

    function custom_override_checkout_fields( $fields ){
           unset($fields['billing']['billing_country']);
          return $fields;
    }
    add_filter('woocommerce_checkout_fields','custom_override_checkout_fields');

    and to remove from both Billing & Shipping details add this

    function custom_override_checkout_fields( $fields ){
          
          unset($fields['billing']['billing_country']);
          unset($fields['shipping']['shipping_country']);
         return $fields;
    }
    add_filter('woocommerce_checkout_fields','custom_override_checkout_fields');
    Adapta

    (@adaptaonline)

    I didn’t work.
    I already show only one conutry in my list, at cart page, but I need it to start with Brasil checked. Now the page starts with a blank option, instead of Brasil option.

    See the link:
    https://ibb.co/SVsCT4p

    Stef

    (@serafinnyc)

    I don’t think we’re on the same page.

    Like I said earlier, if you only want Brasil Then in your settings choose “Sell To Specific Country” & Ship To Specific Country and choose Brasil for both. Then you will see ONLY Brasil.

    That flyout is theme based, not WC based. Might be their own input based on the minicart.

    Plugin Support madeincosmos

    (@madeincosmos)

    Automattic Happiness Engineer

    Hi @adaptaonline,

    Normally if there’s only one country enabled the WooCommerce checkout form will get rid of the dropdown field altogether and only display the country name:

    Screenshot: https://cld.wthms.co/BkPPFQ

    If that’s not how it works on your site, this means that the checkout page template is changed in the theme code. If you have any questions about how it works, I’d recommend to get this checked with your theme developers.

    Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Predefined Country in Cart and Checkout Page’ is closed to new replies.