Steps to reproduce the behavior:
Thanks for opening this issue! We will help you to keep its state consistent
In 1.7.6.7 this error was already display but differently
In 1.7.7.0 beta
@PrestaShop/prestashop-product-team could you check this error ? maybe we can change the wording to be clearer ?
@sarahdib What does that error even mean for the merchant, when he cannot do anything about it? :-)
And, I think we should display: "This product no longer exists in catalog" under it's name in the list. What do you think?
@Hlavtox I agree, the wording is not clear for the merchant. I ask the product team to check the wording ;)
You're right, there is a confusion here between the action and the notification displayed as a consequence. If I understand well, the user can edit the price of a recently deleted product inside the order page but there is an unrelated/unclear error displayed.
@marionf, @MatShir, this behavior does not look specified here. Do we wish to let the user modify the price of a product when this item has been deleted? If yes, there should not be any error notification. If no, the user should not be able to perform this action and the error message should explain why.
Your wording looks okay to me, @Hlavtox. I would suggest _You cannot edit the price of a product that no longer exists in your catalog._ localized in Admin.Notifications.Error.
@LouiseBonnard @MatShir
Personally, I would keep the functionality. All the data is in _order_detail_ table. There is no problem for merchant to change price or quantity of the product. We also know the tax group from DB.
If I'm not mistaken, the price is related to the cart / order ? @jolelievre
A merchant might want to change it for a particular order even though the product has been deleted of the catalog
So, yes there shouldn't be any error notification here
I'm not 100% sure about allowing the modification for several reasons:
All these questions are only the beginning, but each one will imply complexifying the code a lot for an edge case. I'd say it would be more efficient to prevent the merchant to remove a product that has been assigned to an Order, and use soft delete instead (not sure it exists on product for now). Rather than fixing the problems at the end of the tunnel it might be better to fix it at the beginning.
Hi everyone,
I raise this topic again to decide what we can do for this issue. I think introducing the deleted
field on Product would be the best solution. So product would be soft deleted when they are associated to an order (maybe a cart as well).
However this implies quite some changes in various part of the code, especially on the FO where deleted products will have to be filtered. This is not a trivial change and doing it in 177 seems a bit risky. Especially since the bug already existed in previous versions so it's not a regression.
So I would suggest fixing this issue in two steps:
You cannot edit the price of a product that no longer exists in your catalog.
localized in Admin.Notifications.Error
What do you guys think?
It suits me fine, thanks @jolelievre! I've just updated your comment with a wording that better matches the software's terminology and with the proper domain.
@LouiseBonnard @jolelievre @eternoendless
Guys, what about taking it from the other end?
I wanted to introduce you an idea, when merchant can add a non existent product to an order. He woud click “add custom item”, enter name, price, tax, quantity, done. Without having to creating this product in catalog section. This is for custom scenarios when customer wants some spare parts or product out of your digital offers, something that does not sell so often.
Would it be possible to just handle the scenario when the product no longer exists?
I prefer @jolelievre 's idea since we already have a generic soft delete mechanism on prestashop model objects, let's be consistent, your scenario is interesting but complexifies the code imho :/
Most helpful comment
I'm not 100% sure about allowing the modification for several reasons:
All these questions are only the beginning, but each one will imply complexifying the code a lot for an edge case. I'd say it would be more efficient to prevent the merchant to remove a product that has been assigned to an Order, and use soft delete instead (not sure it exists on product for now). Rather than fixing the problems at the end of the tunnel it might be better to fix it at the beginning.