Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Chosen methods are in the session:

    $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );
    Thread Starter Musilda

    (@musilda)

    Yes, i know this, but i need get option for selected method.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    This does give you the selected method; from that you can get instance IDs etc and do a separate lookup.

    Thread Starter Musilda

    (@musilda)

    I am confused. Can you help me with this? I dont know, how separate instance_id.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    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 ?

    Moderator Marius L. J.

    (@clorith)

    @huykon3006 Please do create your own topic, this one is nearly 8 months old at this time.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to get instance id selected shipping method’ is closed to new replies.