1. Documentation /
  2. Smart Coupons /
  3. How to restrict a coupon based on product attributes

How to restrict a coupon based on product attributes

Smart Coupons provide a powerful, “all-in-one” solution for gift cards, store credits, discount coupons, and vouchers extending the core functionality of WooCommerce coupons.

Smart Coupons also provides advanced coupon restrictions based on product attributes, product taxonomy, user roles and others.

This doc article explains how using Smart Coupons, you can validate, show/exclude a coupon based on product attributes.

This means product attribute restrictions can be set in two ways:

  1. Product attributes that the coupon will be applied to, or that need to be in the cart in order for the discount/gift certificate to be applied.
  2. Product attributes that the coupon will not be applied to, or that cannot be in the cart in order for the discount/gift certificate to be applied.

Earlier, to restrict products based on attributes, you need to add all product variants (hundreds and thousands) which is not the case now. Enter the product attributes and Smart Coupons will handle the rest. This is one of the biggest time-saving features store owners would come across.

Steps to restrict a coupon based on product attributes ↑ Back to top

Consider the following sample case: You want to offer a flat discount only when the user adds a Red T-shirt to the cart irrespective of other attributes.

  1. Go to your WordPress Admin panel. Click on Marketing > Coupons.
  2. Create a new coupon or open an existing one. Enter the required details.
  3. Go to the “Usage restriction” tab.
  4. Under Products, search and select the desired T-shirt.
  5. Look for the field “Product attributes”, select Color as ‘Red’. Here, you need to enter the attributes on which you want to allow the usage of this coupon. In this example, the coupon will get applied only if a Red-colored T-shirt is added to the cart.
  6. Publish/Update the coupon.

Now, whenever a user adds a Red color T-shirt to the cart, the discount coupon will be applied.

If a user adds a Black or Blue color T-shirt, the coupon won’t be applied.

Steps to exclude a product attribute from a coupon ↑ Back to top

This is exactly the opposite of the above example.

In this case, you want to apply a coupon on all T-shirt colors except for the Red color.

  1. Go to your WordPress Admin panel. Click on Marketing > Coupons.
  2. Create a new coupon or open an existing one. Enter the required details.
  3. Go to the “Usage restriction” tab.
  4. Under Products, search and select the desired T-shirt.
  5. Look for the field “Exclude attributes”, select Color as ‘Red’. Here, you need to enter the attributes on which you don’t want to allow the usage of this coupon. In this example, the coupon will not get applied if a Red-colored T-shirt is added to the cart.
  6. Publish/Update the coupon.

So, whenever a user adds a Black-color T-shirt or Blue color T-shirt, the discount coupon can be applied.

If a user adds a Red color T-shirt, the coupon won’t be applied.

Note: It is not compulsory to specify a product/products under Usage Restriction > Products. If a product is not specified, the attribute restriction will work irrespective of the product.

WooCommerce

The most customizable eCommerce platform for building your online business.

  • 30-day money back guarantee
  • Support teams across the world
  • Safe and secure online payment