Filtering with perch_shop_product_variants
I've noticed that using the
filter option with
perch_shop_product_variants() filters through variants of all products rather than just those of the product specified in the first parameter.
perch_shop_product_variants(perch_get('s')) only outputs variants belonging to the product specified in the first parameter as expected.
While the below outputs any variant of any active product that meets the filtering criteria (regardless of the slug provided in the first parameter):
perch_shop_product_variants(perch_get('s'), [ 'filter' => 'stock_level', 'match' => 'gte', 'value' => 1, ]);
I can use multiple filters to also filter by the product slug so it's not the end of the world. I'm just reporting this in case it is not the intended behaviour.
Want to reply to this thread?Login with Perch