Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › Order_shipping_items do no always contain vendor_id
Tagged: Shipping, shipping items, vendors
- This topic has 1 reply, 2 voices, and was last updated 5 years, 4 months ago by WCFM Forum.
- AuthorPosts
- August 1, 2019 at 1:36 pm #74737jannis.von.albedyllParticipant
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.
- August 3, 2019 at 6:36 am #74946WCFM ForumMember
Hi,
Well, if shipping package is not generated for vendor then it will not contain vendor_id.
Thank You
- AuthorPosts
- You must be logged in to reply to this topic.