Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce coupon code per line item

Is there any way to set up a coupon code in WooCommerce so that a usage is counted for each line item in the order?

Example process:

  1. Customer has a voucher code unique to themselves with 100 use maximum
  2. Customer places an order with 10 products in it and uses the voucher code
  3. Voucher now has 90 remaining uses

And another:

  1. Customer has a voucher code unique to themselves with 100 use maximum
  2. Customer places an order with 200 products in it and uses the voucher code
  3. Voucher now has 0 remaining uses
  4. Customer pays full price on the remaining 100 products

As it is, I can't see any core way to do this, or any third party extension that would allow it.

like image 516
jsims281 Avatar asked Nov 13 '13 16:11

jsims281


People also ask

How do I set up automatic discount in WooCommerce?

WooCommerce Auto Added Coupons plugin allows users to create a coupon code in WooCommerce and then automatically apply it to the cart. This option is provided to the user in the coupons tabs of WooCommerce in the dashboard. The admin just needs to check a simple checkbox to apply the discount coupon automatically.


2 Answers

Agreed with Richard Green that you'll have to do your own custom code for this unfortunately. It looks like native woocommerce doesn't even have user specific coupons.

For that aspect of your problem there are plugins you could buy if you're willing to spend some money. For example:

http://ignitewoo.com/woocommerce-extensions-plugins/woocommerce-gift-certificates-pro/ or a plugin from woothemes called smart coupons(I can only post 1 link)

You could then write custom code to hook into those.

like image 165
James Jones Avatar answered Oct 13 '22 01:10

James Jones


You will need to create your own custom discount type and logic: http://docs.woothemes.com/wc-apidocs/class-WC_Coupon.html

like image 25
Richard Green Avatar answered Oct 13 '22 00:10

Richard Green