Order_shipping_items do no always contain vendor_id

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WC Marketplace Order_shipping_items do no always contain vendor_id

Viewing 1 reply thread
  • Author
    Posts
    • #74737

      The order_shipping_items from $order->get_items( 'shipping', 'line_item' ); do not always contain the meta-field ‘vendor_id’.

      1. When in the database field _wcfmmp_shipping a value is provided for "_wcfmmp_user_shipping_type", like "_wcfmmp_user_shipping_type":"by_zone", it works:

      foreach($order_items_shipping as $shipping_item) {
          if($shipping_item->get_meta('vendor_id', true) == $vendor_id){

      The get_meta-function returns the correct vendor_id.

      2. When in the database field _wcfmmp_shipping no value is provided for "_wcfmmp_user_shipping_type", like "_wcfmmp_user_shipping_type":"" it DOES NOT work:

      foreach($order_items_shipping as $shipping_item) {
          if($shipping_item->get_meta('vendor_id', true) == $vendor_id){

      The get_meta-function returns no vendor_id.

    • #74946
      WCFM Forum
      Member

      Hi,

      Well, if shipping package is not generated for vendor then it will not contain vendor_id.

      Thank You

Viewing 1 reply thread
  • You must be logged in to reply to this topic.