• Resolved joshnyc

    (@jlavinsky)


    Is there a way to get the plugin to show user all countries in the flag dropdown (besides modifying frontend.js or providing an array of all countries)? We have US only set in woo commerce as we provide services only in the US but have customers that visit from all countries with phone numbers that could be in any country.

    Thanks in advance for your help.

    Josh

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Precious Omonzejele

    (@preciousomonze)

    Hello @jlavinsky , The plugin uses Your Available store base countries by default.
    Luckily there’s a hook that helps with this, will just need a little tweak.
    give me some time.
    ?????♂?

    Plugin Author Precious Omonzejele

    (@preciousomonze)

    https://gist.github.com/Preciousomonze/03c54e7e0cc0e11ca709832bc757810b

    That is where i put most of the custom hooks for the plugins.

    So add this to your functions.php or snippet (anywhere you know how to)

    function pekky_cx_allowed_countries( $countries ) {
    	// Get all countries from woocommerce.
    	$countries = array_keys( WC()->countries->get_countries() );
    	return $countries;
    }
    add_filter( 'wc_pv_allowed_countries', 'pekky_cx_allowed_countries' );
    

    Tested and should work.
    Please let me know if this solves your issue. ????

    • This reply was modified 4 years, 2 months ago by Precious Omonzejele. Reason: commented out $countries by mistake ??
    Thread Starter joshnyc

    (@jlavinsky)

    This works – really appreciate the fast response!

    Josh

    Plugin Author Precious Omonzejele

    (@preciousomonze)

    Cool, no problem!
    Glad it worked, and you find the plugin useful.

    Please do not forget to leave a review ?? for the plugin.

    Stay safe! and don’t forget to try out Pancakes today ????????!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show all countries’ is closed to new replies.