
Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on September 1, 2021, 11:29
Hello
But in this case, the user will not be able to change the country of delivery.
if this is what you want to get. An Example:
function woo_override_checkout_fields( $fields ) {
if(class_exists('WOOCS')){
global $WOOCS;
$currency = $WOOCS->current_currency;
if($currency == 'AUD'){
$fields['shipping']['shipping_country'] = array( 'type' => 'select', 'label' => __('My New Country List', 'woocommerce'), 'options' => array('AU' => 'Australia') );
}elseif($currency == 'EUR'){
$fields['shipping']['shipping_country'] = array( 'type' => 'select', 'label' => __('My New Country List', 'woocommerce'), 'options' => array('ES' => 'Spain') );
}
}
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'woo_override_checkout_fields' );
Hello
But in this case, the user will not be able to change the country of delivery.
if this is what you want to get. An Example:
function woo_override_checkout_fields( $fields ) {
if(class_exists('WOOCS')){
global $WOOCS;
$currency = $WOOCS->current_currency;
if($currency == 'AUD'){
$fields['shipping']['shipping_country'] = array( 'type' => 'select', 'label' => __('My New Country List', 'woocommerce'), 'options' => array('AU' => 'Australia') );
}elseif($currency == 'EUR'){
$fields['shipping']['shipping_country'] = array( 'type' => 'select', 'label' => __('My New Country List', 'woocommerce'), 'options' => array('ES' => 'Spain') );
}
}
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'woo_override_checkout_fields' );