• Resolved espox

    (@espox)


    Hey!

    I recently tried to remove a country from the billing_country dropdown menu on checkout page by using the following code. Unfortunately, The code do not touch the “option value”, so that unfortunately the code does not remove the whole “option value” but really only the name of the country. Therefore I then have an empty entry in my dropdown menu.

    But I just want to remove the complete entry including the country. Can somebody help me to remove a country conplettly?

    add_filter( ‘woocommerce_countries’, ‘remove_gb’, 10, 1 );
    function remove_gb( $country ) {
    unset($country[“GB”]);
    return $country;
    }

    • This topic was modified 3 years, 10 months ago by espox.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Country from Country Checkout List’ is closed to new replies.