save items related to supplier in supplier list
This commit is contained in:
@@ -441,18 +441,22 @@ class Wiaas_Cart {
|
||||
if ($product->is_type('simple') && !Wiaas_Product_Category::is_installation($product)){
|
||||
$supplier_id = Wiaas_Product::get_supplier_id($product->id);
|
||||
$supplier_name = wiaas_get_organization_name($supplier_id);
|
||||
$suppliers[] = array(
|
||||
'id' => $supplier_id,
|
||||
'name' => $supplier_name,
|
||||
'estimated_date' => NULL,
|
||||
'confirmed_date' => NULL,
|
||||
'tracking_info' => array()
|
||||
);
|
||||
if (!isset($suppliers[$supplier_id])){
|
||||
$suppliers[$supplier_id] = array(
|
||||
'id' => $supplier_id,
|
||||
'name' => $supplier_name,
|
||||
'estimated_date' => NULL,
|
||||
'confirmed_date' => NULL,
|
||||
'tracking_info' => array(),
|
||||
'items' => array($product->id)
|
||||
);
|
||||
}else{
|
||||
$suppliers[$supplier_id]['items'][] = $product->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$filtered_suppliers = array_unique($suppliers, SORT_REGULAR);
|
||||
$order->add_meta_data('_wiaas_suppliers', $filtered_suppliers, true);
|
||||
$order->add_meta_data('_wiaas_suppliers', $suppliers, true);
|
||||
|
||||
// add additional date fields to order
|
||||
$order->add_meta_data('_wiaas_global_estimated_delivery_date', NULL, true);
|
||||
|
||||
Reference in New Issue
Block a user