Skip to content

Custom Cart Price Rule condition

I want to implement a new condition that will allow me to limit stock visibility for certain customer groups so they don’t buy it all out.
How to do it?
I assume I have to make a plugin for one of these: MagentoSalesRuleModelRuleConditionCombine, MagentoSalesRuleModelRuleConditionProduct,
MagentoSalesRuleModelRuleConditionAddress.

Goal: Rule will have a condition with a percentage value applied and control the stock visibility per SKU (e.g, product has 200 items in stock, but for a group with 80% stock visibility, it will give 160 only).