8manos / wc-city-select

City Select for WooCommerce. Show a dropdown select as the cities input.
https://wordpress.org/plugins/wc-city-select/
33 stars 41 forks source link

default Countriy #6

Closed mahdi-alavi closed 7 years ago

mahdi-alavi commented 8 years ago

hi if set default Country and remove that field, plugin not work.

function itl_change_default_checkout_country() {
    return 'IR';
}
add_filter( 'default_checkout_country', 'itl_change_default_checkout_country' );

https://docs.woothemes.com/document/change-the-default-state-and-country-on-the-checkout/

function itl_remove_checkout_fields( $fields ) {
    unset( $fields['billing']['billing_country'] );
    unset( $fields['shipping']['shipping_country'] );

    return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'itl_remove_checkout_fields' );
Mantish commented 8 years ago

Hi, I'm not sure what you're trying to do here. Why would you remove the country fields? Does the state dropdown work without the country field?

mahdi-alavi commented 8 years ago

in woocommerce setting i set "Selling Location" to "Sell to specific countries only" (IRAN) in this case there is no need for country field Does the state dropdown work without the country field? NO

Mantish commented 8 years ago

Well, I understand your purpose, but I don't see a lot of value on this (you can always hide the country with CSS) Pull requests are welcome, anyway.