Thread Starter
mfru
(@mfru)
My workaround for now is to use wc_get_products and comparing product ids instead of getting the category_ids from the product directly:
function is_custom_product($product) {
if (! isset($product)) { return false; }
$cat_products = wc_get_products(array(
'category' => array('geschuetzt'),
));
foreach($cat_products as $cat_product) {
if ($cat_product->get_id() === $product->get_id()) {
return true;
}
}
return false;
}
Still a mystery to me, why the category_ids would be different though.
-
This reply was modified 4 years, 7 months ago by mfru.
-
This reply was modified 4 years, 7 months ago by mfru.