Support » Plugin: WooCommerce » WC_Coupon is_valid() method always return false

  • WC_Coupon is_valid() method always return false

    This is my code (you have to set a valid ‘couponcode’):

    $coupon = new WC_Coupon( 'couponcode' );
    if($coupon->is_valid())
      echo 'TRUE';
    else
      echo 'FALSE';

    The output is always: FALSE

    Same thing for is_valid_for_cart() method

Viewing 3 replies - 1 through 3 (of 3 total)
  • It’s a month that I have post this… please Mr Mike Jolley, if you could have a quick look to this and just say something…

    Thanks

    Plugin Author Mike Jolley

    (@mikejolley)

    I cannot really say what’s wrong just by looking at those few lines. How about var dumping in the method itself to see what condition is failing?

    Thank you mike, I will try your suggestion and let you know…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WC_Coupon is_valid() method always return false’ is closed to new replies.