Skip to content
Snippets Groups Projects
Commit 2732c685 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Add WC Product Vendors 2.0 support to evaluate_for_vendors, too

parent 7115b603
Branches
Tags
No related merge requests found
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment