While offering coupons to your customers is a really great way to offer a purchase incentive or to say “thanks for a review!”, you may not want to train customers to look for discounts. If this is the case, they may end up frequently leaving your checkout to go coupon hunting, or may wait to purchase something from your store until they have a coupon available. This runs the risk that they’ll purchase elsewhere in the meantime, or that they abandon your store entirely once a cheaper option comes along.

As a result, some stores want to automatically apply coupons for customers for a particular product using something like Smart Coupons or via URL with URL Coupons, or they just want to hide coupons from the shop pages completely.

Let’s go through some ways to hide coupons from different parts of your WooCommerce store to maximize your conversions and customer happiness.

Removing Coupons

First of all, if you don’t want to use coupons in your store, you can simply disable them under WooCommerce > Settings > Checkout. We’re going to assume here that you want to use coupons and discount codes, but you don’t want to (a) make them obvious to customers so they constantly look for our expect discounts, and (b) you want to hide WooCommerce coupon fields or codes from your store.

Hide WooCommerce Coupon Fields

First, let’s talk about the “apply coupon” fields. When a customer visits your cart or checkout page, they see an “Apply Coupon” field and button. This can sometimes lead customers to abandon your cart to go coupon hunting, which runs the risk that they don’t complete your purchase.

If they do complete the purchase, they may also be dissatisfied since they feel like they missed out on a discount. Regardless, this isn’t the experience we want customers to have while shopping in your store. They should feel great about their purchase and happy to come back to purchase again.

Max wrote a handy tutorial on How to Hide or Rename WooCommerce Coupon Fields that covers how to hide or change these fields.

Our URL Coupons extension will also allow you to do this automatically, as it creates a setting when it’s installed to let you choose to hide coupon fields completely from the cart and/or checkout pages:

woocommerce-url-coupons-hide-fields-settings

If you’re applying discounts automatically via a plugin or via URL, you can completely hide these fields so that only customers that have a discount are aware of it.

If you give out coupon codes, you may want to rename them to something like “Promo Code” so that customers are less likely to go searching for them. A different name implies that this code must have been given out as a promotion rather than as a general coupon, so customers are less likely to go looking for “Promo codes” than they are “coupon codes”.

Passing Discounts to Customers without Coupon Fields

As a quick note, you can still apply discounts even if you hide these discount fields in a couple of ways. First, you can automatically apply discounts with Smart Coupons, as this plugin can apply discounts automatically for particular products in your store.

Smart Coupons can also use a URL to add a coupon. You can add a specific product to the cart via URL based on its ID, and can apply coupons via URL in a similar way. To apply a coupon via URL, you’d have to use ?coupon=code in the URL, but replace code with the coupon code. The URL would look something like this for both adding a product and coupon:

http://mystore.com/cart/?add-to-cart=222&coupon=10off

Or like this for just a coupon:

http://mystore.com/cart/?coupon=10off

Note that in the first example, a ? is only needed in the beginning of this string, and we can tack the coupon on with an ampersand (&).

Want to know more about adding products to the cart via URL? Check out this tutorial from Remi Corson or this tutorial on pricing tables from Patrick Rauland.

To take this even further, URL Coupons can apply discounts automatically via any URL and optionally add products to the cart when a particular URL is visited. This can be a brand new URL just for the coupon, or the URL of an existing post, page, or product.

The biggest benefit to using something like URL coupons is that you can completely hide the coupon code that’s being applied. Rather than passing the coupon code in via URL, you can use whatever URL you’d like, such as http://mystore.com/discount to apply a coupon code. You can then redirect customers to a WooCommerce page (like the cart page) automatically, which means customers may not see the URL passed in. This will ensure that customers have a discount applied, but they’re unaware of the code used to do so.

Hide WooCommerce Coupon Codes Applied

If you want to hide coupon codes entirely from your shop because you’re automatically applying them, there’s one more step you’ll need to take. The coupon code applied will be shown to customers as they complete their order, regardless of how the coupon is applied.

WooCommerce Coupon Applied

Applied Coupon Code

For example, let’s say you’ve followed our tutorial to automatically apply coupons for blog readers. This will apply a coupon for them, but this coupon is also accessible to others if they share the code (which they’ll see in the cart and at checkout).

The woocommerce_cart_totals_coupon_label filter will be able to help us here. Instead of returning “Coupon: CODE”, we’ll want to return a generic message, like “Discount Applied”. We can do that by adding this snippet:

[code lang=”php”] add_filter( ‘woocommerce_cart_totals_coupon_label’, ‘skyverge_change_coupon_label’ );
function skyverge_change_coupon_label() {
echo ‘Discount Applied’;
}
[/code]

This will give us a generic message without the coupon code:

WooCommerce change coupon label

Changed label

We can change the Discount Applied text to whatever we want, such as ‘Coupon Used’ instead.

Conclusions

That’s it! We can do a few things to avoid coupon-crazy cart abandonment. You can:

  • Rename coupon fields to something like “Promo code” using the tutorial referenced above
  • Hide coupon fields on the cart and / or checkout pages if you’d like to apply them via another method (such as via a WooCommerce URL, using Smart Coupons, or URL coupons)
  • Hide the code for the coupon applied from the order summary

We’d love to hear about it if you use these methods!

Published by Beka Rice

Beka leads product direction for SkyVerge and technical documentation. She spends a lot of time on research and interviews, but likes to write so she has an excuse to spend more time jamming out to anything from The Clash to Lady Gaga.

27 Comments

  1. Hide the code for the coupon applied from the order summary

    this is a great tip! thanks for this… we obviously do not want the customer to share the ‘secret mark’ of our special club (discount code)..
    I am sure to use it soon!

  2. […] a quick tutorial from SkyVerge on hiding WooCommerce coupon codes and fields from your site – very useful if you automatically apply coupons via plugin or […]

  3. I dont see those options in woocommerce settings…
    Why not?

  4. Hi Bika,

    nice advice you give. Thank you!
    I am actually looking for a snippet to hide all the coupon info on my Woocommerce Account page! My customers know their private codes, so actually I do not want to disturb them anymore with all the coupon codes they have. So to be clear, I am happy with the coupon fields to be used for the code, but I do not want them to see their own codes on the Cart page and Account page (the Check Out page is fine…..)
    Any suggestions?

    thanks, JP

  5. How does this affect Gift Certificates, though?

    If we remove the coupon code field, there’s nowhere for someone to apply their GC…

    Is there a way that Smart Coupons + URL Coupons can make a URL out of the Gift Certificate code, and then email that URL to the GC recipient?

    • Hey Steven, if you’re generating the gift certificate via Smart Coupons, I’m pretty sure you can create a URL for that, but I’d double-check with the Store Apps devs.

  6. When you click the REMOVE link, though, you can see the coupon code.

    Any solution for that?

    • Hey Steven, there’s not a quick solution, as the current “remove coupon” action requires a page refresh. If you wanted to have some custom code to hide this, you could create an ajax action to remove the coupon so that the page doesn’t refresh / ?remove_coupon=CODE isn’t in the URL. You could then force a page refresh or have a “refresh” button to display the updated cart once the coupon is removed.

  7. Great one! Thanks a lot!
    I have one question how can I change message that is shown on page “Coupon Code Applied Successfully” when discount applied on cart page.

  8. I want to be able to send coupons to select customers, while hiding the fact that there are any available discounts at all from everyone else in the universe (i.e. no coupon code box). Is there a way to do this?

  9. How can I hide coupon from inspect element ? please guide!
    http://prntscr.com/730svo

  10. Hi Beca,

    Very helpful post! Is there a way to restrict use of coupons based on payment method. For example, if i don’t want a coupon to work if cash on delivery is selected. What will be the best way to achieve that.

  11. Great tip for coupon label!!! Thanks!

  12. Hello!

    Great plugin and great tip 🙂

    But I have a problem: I’m trying to hide the coupon code applied, writing the snippet but with no results… I have tried with the Code Snippets plugin and with the functions.php and nothing happens. Any idea?

    Thank you!

    • Try this:

      function skyverge_change_coupon_label() {
          function sv_change_coupon_label() {
                  echo 'Discount Applied';
          }
          add_filter( 'woocommerce_cart_totals_coupon_label', 'sv_change_coupon_label' );
      }
      add_action( 'init', 'skyverge_change_coupon_label' );
      

      If that doesn’t work, your theme is probably using an outdated template and would need to update /cart/cart-totals.php

  13. Can we hide the coupon entry until an item in the cart has a valid coupon? How about only showing the coupon entry when a downloadable item is in the cart?

    I used coupons, but only for downloadable items. I don’t want people thinking there is a coupon for the physical items.

  14. Is there a way to make Coupon (made with Smart Coupons plugin) available AFTER the order, in which the product/gift certificate was ordered, is completed ?

    So, let’s say I create a product which is a gift certificate (linked to a coupon) and someone buys only that product/certificate.
    My shop enables “payment upon delivery”, so I want my shop admin to mark this order as completed before coupon gets available for usage.

    Current version makes it possible to make purchase of a gift certificate, and immediately after use it for other product and make that second order basically free 🙂

  15. There is one more bug with Smart Coupon plugin 🙂

    If you try to bulk generate for example 10 coupons and you set email restriction in the form, then 10 coupons will be generated but only the first of those will have email restriction field populated with e-mail address you set on the bulk generate form… other 9 coupons will be generated with email restriction field empty.

    • That bulk generator (Smart Coupons) also doesn’t name the coupons well – doesn’t add user’s name after prefix. Suppose generator loses “connection” with customer as the e-mail restricion field also is not pushed to other auto-generated coupons.

    • I found the bug, and here’s a quick (not much elegant) fix:

      “wordpress\wp-content\plugins\woocommerce-smart-coupons\woocommerce-smart-coupons.php” :

      line 5090, replace with:
      $customer_email = ( isset( $post[‘customer_email’] ) ) ? $post[‘customer_email’] : ”;//= ( !empty( $customer_emails[$i] ) ) ? $customer_emails[$i] : ”;//bug

      line 5133, replace with:
      $data[$i][‘customer_email’] = ( isset( $post[‘customer_email’] ) ) ? $post[‘customer_email’] : ”;//= ( ! empty( $customer_emails ) ) ? $customer_emails[$i] : ”;//bug

      …this is for Smart Coupons version 3.0.6

      as I can see the function “generate_coupons_code” is called only on this bulk generator wp-admin page, so this changes shouldn’t make any issues elsewhere…

      • While fixing the “bug” I found out why is this happening this way 🙂

        The field “email restriction” accepts more then 1 email (comma separated), so while doing auto bulk generation of coupons, it will loop through the array and assign each of them to next coupon generated.

        OK, so let’s say this is by design, not a bug 🙂
        …but not very user friendly and not documented.

        So I suppose I’ll rewrite that code fix from above to something more elegant (ignore those two lines, 5090 and 5133) – if more then 1 coupon is to be generated, take the first email from the array. So the better way to fix this whole thing is:

        line 5082:
        $customer_emails[$j] = $post[‘customer_email’];//( isset( $emails[$j-1] ) && is_email( $emails[$j-1] ) ) ? $emails[$j-1] : ”;//bug or feature by design

        …this new fix is also better as it will assign all those e-mails to each auto-generated coupon.

Comments are closed.