Jump to content

Cart rules not working properly in PS 1.5.2


Recommended Posts

Hello,

I've spent some time fighting cart discounts and I (or presta) failed :unsure:

 

My pricing policy is that wholesale customers get discounts based on total order amount.

Every product has different discount levels (different products can have different discount levels) which are triggered by total order amount.

 

To make things clear let me show you an example: product A has discount level1 - 5%, leve 2 - 10%, and product B has level1 - 7%, level2 - 12%. Discounts levels are triggered by total order amount, for example > $2000 is level2 and > $1000 is level1. When customer's order falls into level2 he should get 10% discount for product A and 7% discount for product B.

 

I configured cart discounts to achieve this but I see that they are not working as expected. I configured 2 separate cart discounts for 2 products (let's call them productA-level2, productB-level2) . Every cart rule has only rules for product and total order amount and the action is to give discount by percent on selected products. From what I saw in the documentation it should work as expected.

But it doesn't:

post-415886-0-13089000-1354054115_thumb.png

The discount is calculated only for the first rule that matches and for the rest of the rules the discount amount is the same as for the first rule (repeated, not calculated).

 

Should I file this as a bug or I am not aware of something...?

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

Hi sm00th,

 

As far as i understand i have excactly the same issue.

My scheme is pretty much the same as yours :

- Baseline is : if cart amount is equal or more than 2500€

- Consequence 1 is : all products in category A get a 30% discount

- Consequence 2 is : all products in category B get a 10% dicsount

 

But after i set up my cart rules and filled up cart with both "A" products and "B" products (fo more than 2500€ of course) what happens is ... I get 2 times a 30% discount on the whole cart.

 

By now i can't say if it is a bug or the normal behavior of cart rules in PS 1.5.

I've tried to manage different combinations of "compatibility with other cart rules" (not sure of english translation, my PS is in french) on "Conditions" tab, but it failed.

 

I'm starting wondering if there is a logical link between "group of rules" option ("Conditions tab, last item) and "Apply discount to : selected products" ("Actions" tab).

I think the way we try to use cart rules is not the way PS developers have created them. I've read that it has been added to 1.5 to replace an old voucher feature.

I also think we misunderstand the "selected products" option. I've read that with this optoin, customer is supposed to choose on which product he gets the discount.

 

Anyway, may be this feature will be improved in a future update or may be there is a module created for this purpose.

If you find a solution, feel free to share it with me and the community.

 

BR

 

Fred

Link to comment
Share on other sites

  • 2 weeks later...

Hello

I have the same problem, and found it in the source forge as PSCFV-5393. Does anyone have a fix?

 

I've created a rule for 5% discount on purchases from 750€, and a second for 10% discount for purchases above 1500€, for the same client group.

In the cart the first rule is applied twice. I have tried the different combinations of priority, value, and compatibility, but the result is always the same in the cart.

Thanks for any leads.

 

Christine

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Hello,

 

I have also problems with cart rules more specifically the group conditions. If all my groups are "selected groups" then the rule is highlighted under the cart summary for every group. If i unselect 1 group, no matter which one, there are no rules highlighted under the cart summary for any of the groups.

 

I'm using Prestashop 1.5.3.1

 

 

 

Can somebody help me out?

 

Thx

Ben

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

Hi Benjamin,

 

Thanks for your reply!

I pressume you want the different steps i took?...

 

Create a new cart rule

Information:

Fill in name, generate code and enable highlight, disable partial use, priority 1, status active

Conditions:

Valid 1 year

Minimum amount: 500 EUR - Tax excluded - Shipping excluded

Total available: 1000

Total each user: 1000

 

Customer group selection:

Selected: 1 group

Unselected: 5 groups (including guest & visitor)

 

Actions: disable free shipping, apply discount enable percent 5 - disable send a free gift

 

If you need anything else, let me know ;-)

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

  • 2 weeks later...

Hello

I updated to 1.5.3.1 and this did fix the cart rules for my situation, although for big orders there is a slight rounding problem on the totals. However, the upgrade brought me a lot of other problems. Hesitate if you're going to upgrade just to fix this.

 

Christine

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

OK. I've found "A" solution to this issue, which I share here at your own risk.

 

I replaced the /classes/CartRule.php file in 1.5.2 with the /classes/CartRule.php from 1.5.4.1

 

However, there is an extra field in the DB table `cart_rule` - namely: `highlight` which will need to be added (otherwise an error will be thrown). This is a boolean value (I have no idea at this stage what it does or what it's for but as long as it is added to the table, the discounts all getting the same value issue is solved.

 

There is also one other file that I made a change to: /controllers/front/DiscountController.php

 

change line 64 from:
$this->context->smarty->assign(array('nb_cart_rules' => (int)$nb_cart_rules, 'cart_rules' => $cart_rules));

to:
$this->context->smarty->assign(array('nb_cart_rules' => (int)$nb_cart_rules, 'cart_rules' => $cart_rules, 'discount' => $cart_rules, 'nbDiscounts' => (int)$nb_cart_rules));

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...