Show supplier orders, and preview
This commit is contained in:
@@ -88,11 +88,10 @@ class Wiaas_Access_Management {
|
||||
$order = wc_get_order($order_id);
|
||||
$product_from_order = $order->get_items('line_item');
|
||||
|
||||
foreach ($product_from_order as $product) {
|
||||
foreach ($product_from_order as $product_item) {
|
||||
|
||||
$supplier_terms = wp_get_object_terms($product->get_product_id(), 'supplier');
|
||||
$supplier_organisation_slug = $supplier_terms[0]->slug;
|
||||
$supplier_organisation_id = get_term_by('slug' ,$supplier_organisation_slug,'wiaas-user-organization')->term_id;
|
||||
$supplier_organisation_id = Wiaas_Product_Supplier
|
||||
::get_supplier_organisation_id_from_product($product_item->get_product_id());
|
||||
|
||||
Wiaas_User_Organization::assign_post_to_organization($order_id, $supplier_organisation_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user