Hello all,

i just installed 7.x-1.x-dev version of commerce coupon module in my drupal commerce site.I created an 10% percentage discount and activated it.It got discounted from the order total when i loggedin as admin.

But when i use the coupon code as an anonymous user, it always throws an error "Coupon code is not valid".Can anyone please guide me to overcome this issue.

Thanks to all

Comments

Status:Active» Postponed (maintainer needs more info)

It is working for me as anonymous exactly the same as authenticated users.
Coupons are applied through rules, you can enable rules debug and post the results here, maybe the coupon code is not ok?

@pcambra, thanks for your reply.

I try to log the rules, but the coupon log gets creating only for admin orders and not for anonymous orders.I dont know what happen.

Pls guide me a solution.

Thanks

As I said, this is working normally, so other than advising you to have the latest versions of both commerce and coupon modules, I'd need more info to help

am using percentage coupon for my site. i uninstalled the coupon module and reinstalled it.It works only for admin not for anonymous and authendicated.
Please clarify me what exact info you need..

Thanks

Hello all,

i found the reason for coupon not working to anonymous users.i track the process of coupon execution.I found that "commerce_coupon_load_by_code" function returns empty value for anonymous users.

this function is in commerce_coupon.module file at line 534 , where the following query returns Empty value.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'commerce_coupon')
->fieldCondition('commerce_coupon_code', 'value', $code, '=');

I dont know why this happening.Cananyone Please suggest me a solution for this.

Thank you all

when you uninstalled and reinstalled did you look at the permissions for the modules?