3

I am using Magento 1.9.0.1 and I am trying to use the magento coupon code feature. However, it's not working when I add any condition on subtotal.

My condition is if the subtotal is greater than or equal to some amount (say $200) then customer will get 20% discount. I have found that there was a Magento bug. But they have said that they fixed the bug.

However, when it wasn't working then I have used a hack which I have found in the comments of the bug and that extension is working in fresh 1.9.2 in my local environment. However, in the server version of 1.9.0.1 it is not working.

I am debugging the code and found that the discount logic wasn't passing the line

        if (!$rule->getActions()->validate($item)) {
            continue;
        }

I have also found that though I have saved the coupon Action to

Percent of the product price discount

but when I dump the var_dump($rule->getSimpleAction()); then I found the value is "cart_fixed" whereas it should be "by_percent". It means whenever I save the coupon in the admin panel it's not being saved into "by_percent" mode. Instead it's being saved into "cart_fixed" mode which refer to "Fixed amount discount for whole cart".

Could anyone tell me what should I do or what might be the reason behind this?

  • did you get this behaviour on a vanilla magento? – roman204 Jan 15 '16 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.