pluggabl / woocommerce-jetpack

http://booster.io/
24 stars 5 forks source link

wholesale price is enabled for products not specifically denied #32

Open mjdewitt opened 2 years ago

mjdewitt commented 2 years ago

Hi,

I ran into a problem recently with Version: 5.5.1 where products not specified as included (enabled) in the whole price setting where being enabled.

I believe the problem is in wcj-functions-products.php where the default for every product is enabled:

line 436 $is_product_eligible = true;

Considering the product and category include/exclude rules, it's a bit tricky to know which rules should be populated. As it is now, without excluding all product categories, all products will be enabled for wholesale pricing. This makes products included meaningless if a product's category isn't excluded.

I think the better approach is to set the eligible flag to false. This would make it harder to specify all products, but that can be overcome by including all product categories (for huge sites this may still be an issue). However, with false as the default, I believe all of the product and category include and exclude rules will work as you would expect.

Perhaps adding a new rule for "all products" is the way to get everything to work?