Title: Automatically Updating Coupon Code
Last modified: September 1, 2016

---

# Automatically Updating Coupon Code

 *  [akinnc](https://wordpress.org/support/users/akinnc/)
 * (@akinnc)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/automatically-updating-coupon-code/)
 * I currently have a coupon set up in my shop that offers 50% off an item and free
   shipping. I have it limited to 1000 uses. Is it possible to have it auto update
   after 1000 uses? For example if I use the coupon code abc – for the first 1000
   customers it will give 50% off + free shipping, and after those 1000 uses, it
   will update to 30% off?
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

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

 *  Plugin Support [Riaan K.](https://wordpress.org/support/users/riaanknoetze/)
 * (@riaanknoetze)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/automatically-updating-coupon-code/#post-7675679)
 * There’s no option in WooCommerce for that setup; It’ll require some custom coding
   to achieve that 🙂
 *  [jrwpsolution](https://wordpress.org/support/users/jrwpsolution/)
 * (@jrwpsolution)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/automatically-updating-coupon-code/#post-7675688)
 * Hello [@akinnc](https://wordpress.org/support/users/akinnc/),
 * There is a no any option in WooCommerce but you can able to do customization.
 * Please follow below steps for customization:
 * 1) Once customer will purchase order with use of coupon then you should have 
   to store count in option table.
    2) You can get particular coupon used count 
   by using this query: “SELECT COUNT(DISTINCT `order_item_id`) FROM `wp_woocommerce_order_items`
   WHERE `order_item_name` like ‘50%discount'” 3) You have to check that if coupon
   used count is more then 1000 then change discount amount to 30% 4) You can do
   it by: update_post_meta( $coupon_id, ‘coupon_amount’, 30 );
 * Please let me know if you need more help..:)
    Thanks,

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

The topic ‘Automatically Updating 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/)

 * 2 replies
 * 3 participants
 * Last reply from: [jrwpsolution](https://wordpress.org/support/users/jrwpsolution/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/automatically-updating-coupon-code/#post-7675688)
 * Status: not resolved