Prestashop: Bug in displayed discount when adding product (linked to a coupon) to an existing order from BO

Created on 20 May 2019  路  16Comments  路  Source: PrestaShop/PrestaShop

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create a coupon rule with: empty code + product restriction + discount amount
  2. try to add this product above (linked to the coupon) to any existing order
  3. you will see that the discount is duplicated
  4. also if you delete the discount from the order, the discount displayed ins incorrect

Screenshots
1!UNITO-UNDERSCORE!part1
1!UNITO-UNDERSCORE!part2
1!UNITO-UNDERSCORE!part3
2!UNITO-UNDERSCORE!part1
2!UNITO-UNDERSCORE!part2

Additionnal information
PrestaShop version: 1.7.5.0
PHP version: 7.2

1.7.5.2 1.7.6.0 BO Bug Discounts Fixed Major Order Taxes and Prices

All 16 comments

Hi @hanicab,

Thanks for your report.
I manage to reproduce the issue with PS1.7.6.0beta1 & PS1.7.5.2.

The cart rule:

  1. has no code
  2. product selection a product with 100 euro tax included / without product selection => same issue
  3. discount amount of 500 EUR tax included

PS1.7.6.0:

  1. add the product to old order
  2. discount value =100 EUR = price of the product => diffent from the FO
  3. Discounts = 200 EUR => Incorrect
  4. Total => incorrect
    image

PS1.7.5.2

  1. add the product to old order
  2. discount value =100 EUR = price of the product => different from the FO
  3. Discounts = 600 EUR = 500EUR + 100 EUR=> Incorrect
    4.Total discount => Incorrect

image

In the FO => ok

image

I鈥檒l add this to the debug roadmap so that it鈥檚 fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

@khouloudbelguith Thank you for your reply

I want to tell that I have also an incorrect discount if the cart rule is without any product restriction.

Can you try to reproduce this please ?

@hanicab, it is a different issue?
this discount is added from the BO? / FO?
Thanks!

it is different in just 1 step.

when you create the cart rule, no need to set a product restriction to the cart rule. (just empty coupon code and discount amount)

then try to add any product to any existing order, you will see that the total order wiol be incorrect

@hanicab, yes you are right.
Thanks!

@khouloudbelguith You are welcome,

I think that it will be better to add that as comment in the issue , it can be important for devloppers when resolving problem

@hanicab, yes, I just edited my last comment.
Thanks!

@MatShir do you know if this issue has been fixed with the page migration ?

In stand-by waiting for the order page to be fully migrated.
We need to check if the issue is still present once all order PRs have been merged.

This issue needs to be tested with the new migrated order page. If it is not fixed, it should be fixed in 178.

Hi @Progi1984,

I tried with the branch 1.7.7.x (Migrated Order page)

  1. The cart rule:
    1.1. has no code
    1.2. product selection a product with 100 euro tax included
    1.3. discount amount of 500 EUR tax included
  2. add the product to the old order
    image
    => the product is well added but
  • The price of the product is incorrect ( It is displayed Tax excluded => but it should be tax included)
    It only occurs with dummy data (order created by default) => #17994 / This issue does not occur with an order created manually. :notebook: NOTE : This will be fixed in 1.7.8:notebook:

  • discount value = price of the product => different from the FO
    image

  • The block discount is not displayed
    image

  • Total => incorrect

Thanks!

Thanks @khouloudbelguith for testing this. I would recommend to fix it in 178 then. What do you think @Progi1984 ?

@colinegin In the last comment, I think we can fix the last item "The block discount is not displayed" for 177x. May be we should divide this comment in multiple issues ?

Alright, let's do it then !

About issue 2 : discount value = price of the product => different from the FO
@khouloudbelguith i'm not sure I understood the problem. Could you give me more details please?

And also about issue 4 : total => incorrect. Do you know where is the issue ?

Hi @colinegin,

About issue 2 : discount value = price of the product => different from the FO
@khouloudbelguith i'm not sure I understood the problem. Could you give me more details please?

Thre is a difference between the BO and the FO when the sam cart rule is applied.
image

  1. In the FO, when the cart rule is applied
    The discount value = 500 Euro
    It is the value discount added
    image

  2. In the BO => Order details page, when the same cart rule is applied on an old order
    The discount value = the price of the product added which is different from the discount value in the FO.
    image

Thanks!

Fixed by #18205 & #18204

Was this page helpful?
0 / 5 - 0 ratings