#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Coupons and Discounts

Encouraging Purchases with Discounts

Coupons and discounts are a proven way to encourage first-time purchases, reward loyal customers, and clear out seasonal stock in a WooCommerce store.

Creating a Coupon in WooCommerce

Go to Marketing > Coupons > Add Coupon to set a unique coupon code that customers will enter at checkout.

Choose a discount type, percentage, fixed cart discount, or fixed product discount, and set the discount amount.

Setting Usage Restrictions

Add restrictions such as a minimum spend, expiry date, or limit on how many times a coupon can be used.

Restrict coupons to specific products or categories if you want to promote particular items.

Discount TypeExampleBest Used For
Percentage discount10% offSitewide or seasonal sales
Fixed cart discount$5 off cartEncouraging larger orders
Fixed product discount$2 off one itemPromoting a specific product

As your store starts processing real orders and customer data, protecting it with strong security practices becomes essential.

Turning On Coupons and Filling In Each Tab

If the Coupons screen is missing or customers see no coupon field at checkout, open WooCommerce > Settings > General and tick "Enable the use of coupon codes". The same section has an option to calculate multiple coupons in sequence.

The coupon editor is split into three tabs, and each one controls a different part of the rule:

  • General: discount type, amount, free shipping and expiry date. The free shipping box only works if a Free Shipping method in your shipping zone is set to require a valid coupon.
  • Usage restriction: minimum and maximum spend, "Individual use only" to block stacking, "Exclude sale items", included or excluded products and categories, and an allowed email list.
  • Usage limits: total uses per coupon, the maximum number of items the discount applies to, and uses per customer.

Worked Example: A First-Order Welcome Code

Say you want new customers to get 10 percent off their first order above a minimum value, without combining it with other offers.

  1. Create a coupon with the code WELCOME10 and choose Percentage discount with an amount of 10.
  2. Under Usage restriction, set a minimum spend, tick Individual use only and Exclude sale items.
  3. Under Usage limits, set Usage limit per user to 1.
  4. Add an expiry date if this is a limited campaign, then publish.
  5. Test it as a customer: add items below the minimum to confirm the error message, then above it to confirm the discount, then try applying it a second time from the same account.

Keep in mind that the per-user limit is checked against the billing email or logged-in account, so a determined shopper with several emails can still reuse it. For stricter control, restrict codes to specific emails or generate unique single-use codes.

Creating a coupon with code

Developers can create coupons programmatically, for example when a customer subscribes to a newsletter. WooCommerce provides the WC_Coupon class for this:

<?php
$coupon = new WC_Coupon();
$coupon->set_code( 'welcome10' );
$coupon->set_discount_type( 'percent' );   // or 'fixed_cart', 'fixed_product'
$coupon->set_amount( 10 );
$coupon->set_individual_use( true );
$coupon->set_exclude_sale_items( true );
$coupon->set_usage_limit_per_user( 1 );
$coupon->set_date_expires( strtotime( '+30 days' ) );
$coupon->save();

Mistakes That Cost Store Owners Money

  • Stacking by accident. Without Individual use only, a shopper might combine a sitewide sale code with a loyalty code and pay far less than planned.
  • Discounting sale items twice. Leaving Exclude sale items unticked lets coupons apply on top of already reduced prices.
  • No expiry date. Codes shared on coupon websites can keep working long after a campaign ends.
  • Guessable codes. Simple codes like SALE or TEST are easy to try. Use unique codes for high-value offers.
  • Not testing tax and shipping. Check whether the discount applies before or after tax, and whether shipping totals look right.

Before launching any offer, run through this list: coupons enabled, restrictions set, usage limits set, expiry added, a test order placed, and the order report checked to confirm the discount was recorded correctly.

Ready to master WordPress Training Course?

Join Uncodemy's hands-on, mentor-led WordPress training and build real, live websites.

Explore Course