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.