How to Get Applied Coupon Amount In Woocommerce?

6 minutes read

To get the applied coupon amount in WooCommerce, you can use the WC()->cart->get_coupon_discount_amount() function. This function retrieves the total discount amount applied to the cart from coupons. You can use this in your WooCommerce theme files or plugins to display the applied coupon amount to your customers. Just call this function at the appropriate place in your code to get the applied coupon amount.

Best WooCommerce Cloud Hosting Providers of July 2024

1
Vultr

Rating is 5 out of 5

Vultr

  • Ultra-fast Intel Core
  • High Performance and Cheap Cloud Dedicated Servers
  • 1 click install Wordpress
  • Low Price and High Quality
2
Digital Ocean

Rating is 5 out of 5

Digital Ocean

  • Active Digital Community
  • Simple Control Panel
  • Starting from 5$ per month
3
AWS

Rating is 5 out of 5

AWS

4
Cloudways

Rating is 5 out of 5

Cloudways


How to apply a coupon in WooCommerce?

To apply a coupon in WooCommerce, follow these steps:

  1. Log in to your WordPress dashboard and navigate to WooCommerce > Coupons.
  2. Click on the "Add Coupon" button to create a new coupon.
  3. Enter the coupon code in the "Coupon code" field. This is the code that customers will enter during checkout to apply the coupon.
  4. Configure the coupon settings, such as the discount type (fixed cart discount, percentage discount, or fixed product discount), amount, expiry date, minimum spend required, and usage limits.
  5. Once you have configured the coupon settings, click on the "Publish" button to save the coupon.
  6. Share the coupon code with your customers through your website, email marketing campaigns, or social media channels.
  7. When customers are checking out on your WooCommerce store, they can enter the coupon code in the designated field and click on the "Apply Coupon" button to apply the discount to their order.
  8. The discount amount will be deducted from the total order amount, and customers can proceed to complete their purchase at the discounted price.


How to set up coupon restrictions in WooCommerce?

To set up coupon restrictions in WooCommerce, follow these steps:

  1. In your WordPress dashboard, go to WooCommerce > Settings.
  2. Click on the "Coupons" tab.
  3. Find the coupon you want to set restrictions for or create a new coupon by clicking on the "Add Coupon" button.
  4. Fill in the necessary details for the coupon, such as the coupon code, discount type, and amount.
  5. Scroll down to the "Usage restriction" section. Here, you can set up various restrictions for the coupon:
  • Minimum spend: Set a minimum purchase amount that customers must meet to use the coupon.
  • Maximum spend: Set a maximum purchase amount that customers must not exceed to use the coupon.
  • Individual use only: Check this box if you want to restrict the coupon to be used only once per customer.
  • Exclude sale items: Check this box if you want to exclude sale items from being eligible for the coupon.
  • Products: Specify which products are eligible for the coupon. You can choose specific products, categories, or tags.
  • Exclude products: Specify which products are not eligible for the coupon.
  • Usage limit per coupon: Set a limit on how many times the coupon can be used in total.
  • Usage limit per user: Set a limit on how many times each customer can use the coupon.
  1. Once you have filled out all the necessary information and set up the restrictions, click on the "Save changes" button to save the coupon.


Your coupon restrictions are now set up in WooCommerce, and customers will need to meet the specified criteria to use the coupon during checkout.


How to set an expiration date for a coupon in WooCommerce?

To set an expiration date for a coupon in WooCommerce, follow these steps:

  1. Log in to your WordPress dashboard and navigate to WooCommerce > Coupons.
  2. Click on the "Add Coupon" button to create a new coupon or edit an existing one.
  3. Fill in the coupon details such as the coupon code, discount type, amount, etc.
  4. Scroll down to the "Usage Restriction" section and check the box next to "Limit Usage to Expiry Date." This will enable the expiration date field.
  5. Enter the expiration date for the coupon in the "Expiry Date" field. You can select the date from the calendar or manually enter it in the format yyyy-mm-dd.
  6. Save the coupon by clicking on the "Publish" or "Update" button.


Now, the coupon will expire on the specified date and will no longer be valid for use by customers.


How to remove a coupon from an order in WooCommerce?

To remove a coupon from an order in WooCommerce, you can follow these steps:

  1. Log in to your WordPress admin dashboard.
  2. Go to WooCommerce > Orders in the left sidebar menu.
  3. Find the order that you want to remove the coupon from and click on it to open the order details.
  4. In the order details page, find the applied coupon code in the "Discounts" or "Discount Coupons" section.
  5. Click on the "Edit" or "Remove" button next to the coupon code to remove it from the order.
  6. Save the changes to update the order without the coupon.


This will remove the coupon from the specific order, and the discount amount associated with the coupon will be removed from the order total.

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

Related Posts:

To change a WooCommerce coupon code, you can go to your WordPress dashboard and navigate to WooCommerce > Coupons. From there, you can find the coupon you want to change, click on it to edit the details, and then update the coupon code as needed. Make sure ...
To remove all coupon validation in WooCommerce, you can disable the coupon functionality altogether. This can be done by adding a code snippet to your theme's functions.php file or by using a plugin like Code Snippets. By disabling the coupon validation, c...
To check if a coupon has granted free shipping in WooCommerce, you can do the following:Go to your WooCommerce dashboard and navigate to the Coupons section.Find the coupon code that you are interested in checking for free shipping.Edit the coupon and scroll d...