Jump to content

PS 1.6.1.6 product quantity discount incorrect when used with combinations that increase price


DavidCBL

Recommended Posts

Hi,

 

I've been looking for the past day for a solution to this problem but so far have found nothing that fixes the problem. I'm using the default bootstrap theme on PrestaShop 1.6.1.6. I've also tried 1.6.1.7 and it's the same problem.

 

I have my prices all set to include tax at 20%.

 

I have a product with say base price 255 (inc tax 306) and two combinations, the first with no increase (so still 255 and 306), the second with an increase of 5 to 260 (inc tax 312).

 

I've created a specific price rule using a base of 260 not 255 and a decrease of 2 inc tax for 5+ units. This would make it 310 inc tax. I've tried working off the base but it doesn't take into account the +5 increase from the combination so it's 306 - 2 and not 312 - 2. If I use tax excl for the -2 reduction (so it's 2.40) then the price is 303.60 (306-2.40), which is still ignoring the increase of 5 from the combination.

 

In this scenario the volume discounts table is correct at 2 in the discount and saving of 10 though the actual price is wrong.

 

However, if I work on a specific price of 260 with a reduction of 2 on quantity of 5+ my price reduction is correct in the top right of the product page at 310 and it's correct when added to the cart but the volume discount shows as -4 and you save as -20.

 

It seems to be working this out as (260 + 20% - 2) = 310 but 310 is 4 higher than 306 so it's a discount of -4. It should in fact be using the base price from the combination, so it should have had a base of 312 not 306 so it would have shown the discount as 2.

 

I've tried lots of combinations of tax inc/ex and various specific pricing and I can either get the volume discount to show correctly and the price wrong or the price right and the volume discount wrong.

 

Does anyone know a way to change the volume discount so it works off the combination actual price increase from the base rather than just the base value?

 

(I forgot to add, in preferences I do have it set as quantity discount based on combinations and not product but this setting has no effect either way)

 

Thank you,

David

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

I think the problem seems to be in ProductController.php with the call to formatQuantityDiscounts() with the base price rather than the combination price. This is giving a real_value of -4 rather than the expected 2 in my case. However, I can't just change this to use the combination price as the actual price display in the upper right is correct and breaks if I change it to correct the volume discount price.

 

Someone must have come across this problem previously and fixed it, if you have I'd appreciate some input :)

Link to comment
Share on other sites

I've FINALLY found a 'hack' that works for me though I'm not sure if it's correct.

 

In product.tpl change line 425 to data-discount="{$quantity_discount.reduction|floatval}" from data-discount="{$quantity_discount.real_value|floatval}" 

 

and

 

change line 438 to {convertPrice price=$quantity_discount.reduction|floatval} from {convertPrice price=$quantity_discount.real_value|floatval}

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

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...