Prestashop: Exception when adding a new discount with invalid amount - invalid discount

Created on 19 Feb 2020  路  9Comments  路  Source: PrestaShop/PrestaShop

Describe the bug
In the BO => Orders => new migrated Order details page or legacy page when we add a new discount with an invalid amount for example -10 => an exception is displayed

To Reproduce
Steps to reproduce the behavior:

  1. Go to BO => Orders => new migrated Order details page admin-dev/index.php/sell/orders/orders/5/view or the legacy page
  2. Click on "Add a new discount" button
    2.1. Type = Amount
    2.2. Value = -10
  3. Click Add
  4. See error
    image
    image

Additional information
PrestaShop version: 1.7.7.x, 1.7.6.3, 1.7.5.2
PHP version: 7.1

1.7.5.2 1.7.6.3 1.7.7.x BO Bug Discounts Fixed Major Order

All 9 comments

Ping @colinegin new issue in the Order page

Hi,

Same issue with an invalid percent value
An exception detected when we add a new discount = -10%
image

image

Reproduced with 177x branch, PS1.7.6.3 and PS1.7.5.2

Thanks!

Hi @Hlavtox,

We have different exceptions:

13809: Property Order->total_paid is not valid

17747: Property CartRule->reduction_prcent is not valid / Property Order->total_discounts is not valid

They are not similar but they are just related.

Thanks!

The behaviour should be the same as in the cart rule page. When adding a discount value (in %) containing a "-", this error message is displayed :
image

And when adding a discount value (in amount) containing a "-", this error message is displayed :
image

So IMO we should be consistent and do the same in the order page.

After discussing with @TristanLDD and @LouiseBonnard the wording for error messages should be the same as in the cart rule page and the error message should be located on top of the order page. When a error occurs, the pop-up is closed and the user has to re-open it to add a cart rule.

@colinegin, as long as we stay consistent and display the same error message when the same mistake is done, it suits me fine! :-)

@atomiix, as @colinegin said, and especially if the error notification is displayed on the top of the page and not in the modal, I prefer to keep the wording consistent and use the same error notifications as in the cart rule page.

@LouiseBonnard @colinegin

Wouldn't it be better to go upfront the employee and just remove the minus from the input, so he can enter the discount with minus or not? Maybe it would be even easier to do and more comfortable for employees.

Because, when you look on it from the other side, the discount is really -15%, why should he be forced to enter positive value?

Fixed by #17852

Was this page helpful?
0 / 5 - 0 ratings