Exclude Coupon from a Payment Method


  • Default avatar
    restodo    
     9 years ago
    0

    Hello,

    I want to know if there is a chance to Exclude a Coupon from a Payment Method.

    For example, I have two payment method (1 - Cash On Delivery, 2 - Credit Card)

    I want to create a coupon to be used with Cash On Delivery only. Is it possible?


    Regards!
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    It is not possible to create a coupon code based on payment method, never had that request before. You can however create based on country if that is any help.
  • Default avatar
    restodo    
     9 years ago
    0

    Thanks for your reply, it's a shame that is not possible. I would be useful.

    I think the only way is to add some code to your files.
    I've been testing to add some IF statement in estorecouponhandler.php and works only checking payment method but when I've tried to add another check for coupon code entered it didn't work.

    Is there any chance to know what is the variable where the entered coupon code is store in cart? I've tried with $cart->couponCode


    Regards!
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    With AwoCoupon, if enabled by the administrator, a customer can enter multiple coupon codes in one order. It really depends where you are trying to check this. To check the last entered code the customer entered, I use this in the file:

    <?php
            $submitted_coupon_code 
    trim($this->get_submittedcoupon());
    ?>


    But if you are within the processing of a coupon code, then you should have this variable

    <?php
    $coupon_row
    ->coupon_code
    ?>