How do I check if ANY coupon is applied to a product in woocommerce at checkout?
Everything I see checks for ID or slug, or an array of them, but I want to adjust some fields at checkout based on whether or not there's a coupon, any coupon.
Thanks in advance.
If you want to check for a specific coupon, @Reigel's answer is the solution. However to check if ANY coupon has been applied the following code will get the job done.
if( WC()->cart->get_coupons() ) echo "Coupon applied";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With