search ]

Adding and Managing Coupons in WooCommerce Stores

Coupons, in our case WooCommerce coupons, can boost sales in your online store. You can sell products faster, sell more products, and even increase traffic to your site using these coupons.

Using coupons also allows you to improve brand awareness, enhance customer loyalty, and can even save you advertising costs.

In this guide, we will explain how to add coupons in WooCommerce stores and give a detailed look at coupon options and settings. If you are interested in a basic guide on building a store with WooCommerce, check out the article Building a Virtual Store in WordPress using WooCommerce.

To get started, if you want to use coupons in WooCommerce, you need to enable the option first. Go to WooCommerce > Settings > General, and under “Enable Coupons” check the option Enable the use of coupons, then save the settings.

Enable the use of coupons in WooCommerce settings

You’ll find more details about the “Calculate Coupon Discounts Sequentially” option further down in the post.

Adding a Coupon in WooCommerce Stores

To add a coupon in a WooCommerce store, follow these steps:

  • In the WordPress admin interface, go to Marketing > Coupons.
  • Create a new coupon by clicking the Add Coupon button or edit an existing coupon.
  • Add the following fields:
    • Coupon Code – the code that the customer will use to redeem the coupon. This code must be unique.
    • Coupon Description (Optional) – information about the coupon, for example – dates it is valid, whether it is a promotional coupon or a compensation coupon, etc.
Adding Coupons in WooCommerce Stores

Under the Coupon Data section, there are three tabs that allow you to add restrictions to the coupon and configure additional settings. These tabs are: General, Usage Restriction, and Usage Limits. Let’s take a detailed look at each of these tabs…


General

The General tab lets you set the discount type, amount, and expiration.

General Coupon Settings WooCommerce
  • Discount Type:
    • Percentage Discount – a percentage discount applied to the entire cart. For example, if the cart contains three shirts priced at $20 each (total $60), a 10% coupon will discount $6.
    • Fixed Cart Discount – a fixed discount for the entire cart. A $10 discount in this type means $10 off regardless of the total items in the cart.
    • Fixed Product Discount – a fixed discount for specific products only. The customer will receive the discount on each qualifying product. If you add three specific shirts, each will get a $10 discount (total $30 off).
  • Coupon Amount – a fixed number or percentage, depending on the discount type you chose. There is no need to add the currency symbol or percentage sign, WooCommerce handles this automatically.
  • Allow Free Shipping – waives the shipping cost when the customer uses the coupon. This requires that a “Free Shipping” method is enabled in your shipping settings.
  • Coupon Expiry Date – the date when the coupon will expire. The expiry occurs at 00:00 (midnight) on the defined date.

Usage Restriction

This tab controls when and where the coupon can be applied.

Coupon Usage Restriction WooCommerce
  • Minimum Spend – the minimum subtotal (items + tax) required for the coupon to be valid.
  • Maximum Spend – the maximum subtotal after which the coupon will no longer apply.
  • Individual Use Only – check this if you want this coupon to not be used together with other coupons.
  • Exclude Sale Items – check this if you do not want the coupon to apply to items already on sale.
  • Products – the products for which the coupon will be valid, or the products that must be in the cart for the “Fixed Product Discount” to apply.
  • Exclude Products – products for which the coupon will not be valid, or products that cannot be in the cart when redeeming the “Fixed Product Discount”.
  • Product Categories – product categories for which the coupon will apply, or categories that must be in the cart for the “Fixed Product Discount” to work.
  • Exclude Categories – product categories for which the coupon will not be valid.
  • Allowed Emails – email address(es) that can use this coupon. This is checked against the customer’s billing email address.

If you leave both Products and Exclude Products empty, the coupon will be valid for your entire store.

Usage Limits

This tab lets you control how many times a coupon can be used.

Coupon Usage Limits WooCommerce
  • Usage Limit Per Coupon – the total number of times the coupon can be redeemed across all customers before it becomes invalid.
  • Limit Usage to X Items – the maximum number of individual items the coupon can apply to within a single order (relevant for product-level discounts).
  • Usage Limit Per User – the number of times a specific user can redeem the coupon before it becomes invalid for that user.

After configuring the coupon to your needs, click Publish and the coupon will be ready for use.

Sending Coupons to Customers

After publishing a coupon, you can share the coupon code with your customers. Simply copy the coupon code and send it via email, social media, or any other channel.

In WooCommerce, you can also apply or remove coupons directly on the Orders screen (WooCommerce > Orders). The order must be unpaid, and you need to know the coupon code you want to apply.

Calculate Coupon Discounts Sequentially

By default, WooCommerce calculates coupon discounts in parallel. This means that if multiple coupons are applied to a cart, each one is calculated based on the original product or cart total – without taking other discounts into account.

Enabling the option to calculate coupon discounts sequentially changes this behavior. In sequential mode, each coupon is applied one after the other, with every new discount calculated based on the amount remaining after the previous one has been deducted.

This approach is useful when combining different types of coupons, such as a percentage-based discount followed by a fixed amount discount. It ensures more accurate and fair calculations.

Need More Options for Managing Coupons?

WooCommerce has several extensions that expand the coupon functionality beyond what the default setup offers. One of these is Smart Coupons which provides advanced options to increase sales. The Smart Coupons extension allows you to:

  • Give automatic discount coupons after purchase.
  • Provide gift certificates that customers can purchase for others.
  • Give customers store credit for purchases in your store.
  • Embed styled coupons on your site using shortcodes.

This extension has been tested on thousands of WooCommerce stores and covers almost everything you might need in terms of coupon management.

Bonus – Changing or Removing the Coupon Text

Since it was requested in the comments, let’s see how to change the coupon-related text on the cart and checkout pages. The following code changes the text “Coupon Code / Apply Coupon” to a custom message.

Add this to the functions.php file and change the text in lines 3, 11, and 14 accordingly:

// Change coupon text and link on the checkout page
function woocommerce_rename_coupon_message_on_checkout() {
    return 'Have a Customer Code?' . ' <a class="showcoupon" href="#">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>';
}
add_filter( 'woocommerce_checkout_coupon_message', 'woocommerce_rename_coupon_message_on_checkout' );


// Change coupon field on the cart page
function woocommerce_rename_coupon_field_on_checkout( $translated_text, $text, $text_domain ) {
    if ( is_admin() || 'woocommerce' !== $text_domain ) {
        return $translated_text;
    }
    if ( 'Coupon code' === $text ) {
        $translated_text = 'Customer Code';

    } elseif ( 'Apply coupon' === $text ) {
        $translated_text = 'Apply Code';
    }
    return $translated_text;
}
add_filter( 'gettext', 'woocommerce_rename_coupon_field_on_checkout', 10, 3 );

To remove the coupon field entirely from both pages, add the following code:

// Hide the coupon field on the cart page
function hide_coupon_field_on_cart( $enabled ) {
    if ( is_cart() ) {
        $enabled = false;
    }
    return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_cart' );


// Hide the coupon field on the checkout page
function hide_coupon_field_on_checkout( $enabled ) {
    if ( is_checkout() ) {
        $enabled = false;
    }
    return $enabled;
}
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_field_on_checkout' );

The code snippets above work with the classic WooCommerce cart and checkout pages. If your store uses WooCommerce’s block-based checkout, these filters may not apply. For block-based checkout, you’ll need to use the JavaScript-based registerCheckoutFilters API instead.

FAQs

Common questions about WooCommerce coupons:

Can customers use multiple coupons on a single order?
Yes, by default customers can stack multiple coupons on one order. However, you can prevent this by enabling the "Individual Use Only" option on a specific coupon, which means that coupon cannot be combined with any other coupon.
What is the difference between parallel and sequential coupon calculation?
With parallel calculation, each coupon is calculated based on the original cart total. With sequential calculation, each coupon is applied after the previous one, so the second coupon calculates its discount on the already-discounted total. Sequential is more accurate when combining percentage and fixed discounts.
Can I create coupons that automatically apply at checkout?
WooCommerce does not support auto-applying coupons out of the box. You would need a plugin like Smart Coupons or custom code using the woocommerce_before_calculate_totals hook to programmatically apply a coupon when certain conditions are met.
How do I restrict a coupon to a specific user or email?
In the "Usage Restriction" tab, use the "Allowed Emails" field. Enter the email address(es) that should be able to use the coupon. WooCommerce checks this against the billing email at checkout. You can also set a "Usage Limit Per User" to limit how many times each person can redeem it.
Do WooCommerce coupons work with the block-based checkout?
Yes, WooCommerce coupons work with the block-based checkout. However, some PHP-based customizations (like changing coupon text via filters) may not apply to the block checkout. For those, you'll need to use the JavaScript-based checkout filters API that WooCommerce Blocks provides.

That’s it, hope this guide helped. If so, feel free to share in the comments. Good luck!

Join the Discussion
0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!

Savvy WordPress Development official logo