Support » Plugin: WooCommerce » How to get the correct vendor id at Checkout Page?

  • Resolved yewbeng0104

    (@yewbeng0104)


    I success display chosen shipping method using the code below:
    ======================

     $chosen_methods = WC()->session->chosen_shipping_methods;
     $chosen_shipping = $chosen_methods[5];
     echo '<pre>';
     echo print_r($chosen_methods);
     echo "<br><br>";
     echo print_r($chosen_shipping);
     echo '</pre>';

    ======================
    I will get the result show at below:
    ======================

    Array
    (
        [18] => flat_rate:32
        [5] => local_pickup:30
        [19] => 
        [20] => free_shipping:22
    )
    1
    
    local_pickup:301

    ======================

    Because the platform (WCFM) is multivendor, so inside array, it will display each vendor’s id: [18], [5], [19], [20] and their current chosen shipping method.

    However, actually I only choose Vendor [5]’s product in cart page, so I expect to show the Shipping Method of Vendor [5] only.

    May I ask: how to get the correct vendor id at Checkout Page?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.