Category "coupon"

WooCommerce coupon usage restriction by allowed user roles

we need to make an automatic discount coupon to be applied if the current user role is ( vendor ), we achieved that by creating a normal coupon then used the sn

Add restriction to WooCommerce coupons by allowed user ID

Let's say i'm using this code to create a coupon: $coupon_code = 'CODEOFF'; $amount = '10'; $discount_type = 'percent'; $coupon = array(

Applying programmatically a coupon to an Order in WooCommerce3

I'm developing a plugin that creates an order directly (no cart) and applies a coupon. In version 3.0 of the woo API the function add_coupon() has been deprecat

Add free product when a certain coupon is applied in WooCommerce

I can add a product to cart, when a certain coupon is used via the woocommerce_applied_coupon hook and the add_to_cart() function add_action('woocommerce_applie