Title: Mandatory Coupon Code
Last modified: August 22, 2016

---

# Mandatory Coupon Code

 *  Resolved [amosb](https://wordpress.org/support/users/amosb/)
 * (@amosb)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/mandatory-coupon-code-1/)
 * Is there a way to make the Coupon Code a mandatory field in the shopping cart?
   I want my users to use the codes that are provided to them and not proceed to
   the checkout page before they enter the code.
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [amosb](https://wordpress.org/support/users/amosb/)
 * (@amosb)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/mandatory-coupon-code-1/#post-5947899)
 * i have try to do this solutions:
    [http://stackoverflow.com/questions/27526677/making-the-coupon-field-mandatory-on-woocommerce/29297000#29297000](http://stackoverflow.com/questions/27526677/making-the-coupon-field-mandatory-on-woocommerce/29297000#29297000)
 * but if i don’t enter the coupon code I am redirected to ../checkout and the page
   is blank..
 *  Thread Starter [amosb](https://wordpress.org/support/users/amosb/)
 * (@amosb)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/mandatory-coupon-code-1/#post-5947921)
 * OK i have found the solutions
    It is replaced in the functions.php code shown
   in the above solution ([http://stackoverflow.com/questions/27526677/making-the-coupon-field-mandatory-on-woocommerce/29297000#29297000](http://stackoverflow.com/questions/27526677/making-the-coupon-field-mandatory-on-woocommerce/29297000#29297000)),
   the string: “$woocommerce->add_error(“Please enter coupon code to checkout.”);”
 * with
 * “wc_add_notice( ‘**‘ . $btn[‘label’] . ‘** ‘ . __( ‘is a required field.’, ‘woocommerce’),‘
   error’ );”

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Mandatory Coupon Code’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [coupon code](https://wordpress.org/support/topic-tag/coupon-code/)

 * 2 replies
 * 1 participant
 * Last reply from: [amosb](https://wordpress.org/support/users/amosb/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/mandatory-coupon-code-1/#post-5947921)
 * Status: resolved