Hi,
i’m trying to get a shipping method label through shortcode. (code mentioned below).
but output showing like : LOCAL PICKUP 1, (Method ID included)
but i need to remove the method id, kindly give me some suggestion.
add_shortcode(‘current-shipping-label’ , ‘ww_get_shipping_method’);
function ww_get_shipping_method(){
$chosen_methods = WC()->session->get(‘chosen_shipping_methods’);
$chosen_shipping = $chosen_methods[0];
if ($chosen_shipping == ‘local_pickup’) {
echo ‘LOCAL PICKUP’;
return true;
}