How to create a rule for specific products only?
In this example, we'll create a rule to restrict the stock quantity to 10 units for products that match the attribute combination of Color: Blue. But for specific products only not all products which contain attribute color as blue.
The steps to create this scenario are below:
- Navigate to the rule creation section in the plugin settings.
- Set the rule status to enabled.
- Assign a title to the rule, such as "Blue Colour Rule".
- Specify the SKU for the rule else it will auto generate from the title.
- Define the stock quantity to which the rule will apply, for example, 10 units.
- If needed, enable the "Limit Product Stock" option to restrict customers from choosing quantities beyond the defined stock quantity.
- Create a new group for the attribute combination.
- Add attributes and terms to the group:
- Attribute: Color, Term: Blue
- Now, If we need to only apply this rule for specific Blue attribute products like select below screenshot:
- Save the rule settings.
- The rule is now active and will restrict the stock quantity to 10 units for product variations matching the attribute combination of Color: Blue and passing our filter product.
Now, we can check the rules on the front end side and see how our product will look when we apply rules to it.
First here we are showing a product that passed our rule’s filter and applied a stock limit on it.
Now we are showing other products with the attribute colour blue but didn’t pass out the rule’s filter.