With the code below, I am able to change the display of specific shipping methods full labels on WooCommerce cart and checkout pages:
add_filter( 'woocommerce_cart_shipping_method_full_label', 'custom_shipping_labels', 10000, 2 );
function custom_shipping_labels($label, $method){
$shpmethod = $label;
if(strpos($shpmethod, 'Express Shipping') !== false){
$shpmethod = str_replace('Express Shipping',' test express lbl',$shpmethod);
}
elseif(strpos($shpmethod, 'Free Standard Shipping') !== false){
$shpmethod = str_replace('Free Standard Shipping',' test free lbl',$shpmethod);
}
return $shpmethod;
}
Now I need to access the customer selected county inside that custom function hooked in woocommerce_cart_shipping_method_full_label
filter hook.
Is it possible to get the customer selected country in that hooked function?