diff --git a/includes/rules_shipping_framework_woocommerce.php b/includes/rules_shipping_framework_woocommerce.php index bd7da511402f145386fc23672d1235c8ddaa26bf..3199766d00c36db1fc087a9cf197a6a4f75583fa 100644 --- a/includes/rules_shipping_framework_woocommerce.php +++ b/includes/rules_shipping_framework_woocommerce.php @@ -444,13 +444,20 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { $vnd_props[] = $vnd->user_login; } - // "WooThemes Product Vendors" support (vendors stored in its own taxonomy) + // "WooThemes Product Vendors"<2.0 support (vendors stored in its own taxonomy) if (class_exists("WooCommerce_Product_Vendors") && function_exists("get_product_vendors")) { foreach (get_product_vendors($p['data']->id) as $vendor) { $vnd_props[] = urldecode($vendor->slug); } } + // "WooThemes Vendor Products">=2.0 support (vendors stored in its own taxonomy) + if (class_exists("WC_Product_Vendors") && method_exists("WC_Product_Vendors_Utils", "get_vendor_id_from_product")) { + $vndid = WC_Product_Vendors_Utils::get_vendor_id_from_product($p['data']->get_id()); + $vendor = WC_Product_Vendors_Utils::get_vendor_data_by_id($vndid); + $vnd_props[] = urldecode($vendor["slug"]); + } + // "YITH WooCommerce Multi Vendor" support (vendors stored in its own taxonomy) if (function_exists("yith_get_vendor")) { $vendor = yith_get_vendor($p['data']->id, 'product');