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:

  1. Navigate to the rule creation section in the plugin settings.
Attribute stock rule configuration section
  1. Set the rule status to enabled.
  2. Assign a title to the rule, such as "Blue Colour Rule".
  3. Specify the SKU for the rule else it will auto generate from the title.
  4. Define the stock quantity to which the rule will apply, for example, 10 units.
  5. If needed, enable the "Limit Product Stock" option to restrict customers from choosing quantities beyond the defined stock quantity.
  6. Create a new group for the attribute combination.
  7. Add attributes and terms to the group:
    1. Attribute: Color, Term: Blue
Attribute term condition set for applying the rule
  1. Now, If we need to only apply this rule for specific Blue attribute products like select below screenshot:
Attribute stock filter for applying the rule
  1. Save the rule settings.
  2. 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.

Frontend product with applied rule

Now we are showing other products with the attribute colour blue but didn’t pass out the rule’s filter.

Frontend product with filtered applied rule
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.