Show supplier orders, and preview

This commit is contained in:
Nedim Uka
2018-10-31 15:04:23 +01:00
parent 51cb2af438
commit 26353f0d80
9 changed files with 220 additions and 14 deletions

View File

@@ -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);
}