Chosen methods are in the session:
$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
Yes, i know this, but i need get option for selected method.
This does give you the selected method; from that you can get instance IDs etc and do a separate lookup.
I am confused. Can you help me with this? I dont know, how separate instance_id.
This contains the method ID, which itself contains the instance_id. e.g. flat_rate:10
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;
}
same problem. I want to get min_amount of Free Shipping method. do you found the way fix it ?
@huykon3006 Please do create your own topic, this one is nearly 8 months old at this time.