Jump to content

SOLVED - Prestashop generic Vouchers visible to all


mitzayapa

Recommended Posts

Hey guys ,

 

I have a strange problem with my ps 1.6.0.8 , for some reason when i manually create a voucher , it appears to all logged clients (my account-my vouchers) , i think its a bug but i can't find the solution for my version (the #5978 aint working).

 

Any idea how to solve it ?

 

It seems it appears to all ONLY if the VOUCHER has a group RESTRICTION.

Edited by mitzayapa (see edit history)
Link to comment
Share on other sites

It is a known error in the vouchers database select. Solution - not tested:

 

Change controllers/front/DiscountController.php around line 42:

 

$cart_rules = CartRule::getCustomerCartRules($this->context->language->id, $this->context->customer->id, true, false, true);

 

The second last parameter changes from true to false which might help.

Link to comment
Share on other sites

Done that , not working.

 

After testing it some more , it seems it only occurs when the voucher (code) has a group restriction (one group ain't allowed to use it), If i create a voucher without a group condition , works as it should.

 

how to make this work ?

Link to comment
Share on other sites

I haven't heard from group restrictions causing this but it's not impossible. There have been a lot of bug fixes since your PS version. It tested on 1.6.1.15 with a group restriction. If set to customer and customer is logged in - I see the voucher. If set to guests or visitors, I don't see the voucher.

Edited by Scully (see edit history)
Link to comment
Share on other sites

I guess its a bug thats solved in newer versions of prestashop , meanwhile the solution i found is this one :

 

getCustomerCartRules funcion from Cartrule.php , remove the "OR cr.group_restriction = 1" (thats the tricky condition).

 

 

Anyway , thanks alot for your help , and for the fast replies.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...