Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving virtual product attachment is modifying product price if a specific price is set on the product #22069

Closed
gennaris opened this issue Nov 24, 2020 · 3 comments · Fixed by #22376
Assignees
Labels
1.7.6.9 Affects versions 1.7.7.0 Affects versions BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Old Products Page Concerns the old product page Taxes and Prices Component: Which BO section is concerned Virtual Product type: issue about virtual products
Milestone

Comments

@gennaris
Copy link
Contributor

gennaris commented Nov 24, 2020

Describe the bug

When using virtual products, retail price is getting modified during attachment save
if there is a specific price set on the product.

Expected behavior

We expect the price remain the same , this is quite major issue as it messed up a lot of product prices in one of
our customer shop.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a "virtual product" with Retail Price Tax Inc € 10.00
  2. Add a specific price on the product (10% discount for ALL customers)
  3. Go in "Virtual product" and add a file attachment, then click SAVE to confirm the attachment
  4. Refresh the page and check the retail price again - It had been set to €9.00 (!) - SAVING the attachment again will cause the price to get lowered again and again..

Additional information

Issue was debugged thanks to the help of M4 module creator.

The wrong line of the code is:

$productAdapter->getProduct() in saveAction method on VirtualProductController
This method sets the product price using any specific price and later saves this wrong price.

  • PrestaShop version: 1.7.6.9
  • PHP version: 7.2
@hibatallahAouadni
Copy link
Contributor

Hello @gennaris

I didn't manage to reproduce your issue with PS1.7.6.9, see the attached screen record below:

https://drive.google.com/file/d/1tFkj7ZqIIQ_AbYezKaSqNM10mCeqtkQO/view

Please check and feedback.

Thanks!

@hibatallahAouadni hibatallahAouadni added 1.7.6.9 Affects versions BO Category: Back Office Bug Type: Bug Old Products Page Concerns the old product page Taxes and Prices Component: Which BO section is concerned Virtual Product type: issue about virtual products NMI Status: issue needs more information labels Nov 24, 2020
@gennaris
Copy link
Contributor Author

@hibatallahAouadni
Since the save attachment is performed with an AJAX request, you need to refresh the page to see the updated (wrong) price.

@hibatallahAouadni
Copy link
Contributor

hibatallahAouadni commented Nov 24, 2020

Hello @gennaris

I managed to reproduce your issue with PS1.7.6.9, PS1.7.7.0-rc.1 and develop, see the attached screen record below:

https://drive.google.com/file/d/1P2LCeSldQUWF7qzcWETPUcQtDrZhuyJP/view

PS: to avoid this problem, all you need is to click on Save button as shown in the screen record [1:10]

Thanks for the report, I’ll add this to the debug backlog so that it’s 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!

@hibatallahAouadni hibatallahAouadni added Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Ready Status: Issue is ready to be worked on and removed NMI Status: issue needs more information labels Nov 24, 2020
@hibatallahAouadni hibatallahAouadni added the 1.7.7.0 Affects versions label Dec 8, 2020
@matthieu-rolland matthieu-rolland added this to the 1.7.8.0 milestone Dec 16, 2020
@matthieu-rolland matthieu-rolland added this to Not ready in PrestaShop 1.7.8.0 via automation Dec 16, 2020
@matthieu-rolland matthieu-rolland moved this from Not ready to To be tested in PrestaShop 1.7.8.0 Dec 16, 2020
@SD1982 SD1982 moved this from To be tested to To be merged in PrestaShop 1.7.8.0 Dec 17, 2020
PrestaShop 1.7.8.0 automation moved this from To be merged to Done Dec 17, 2020
@prestashop-issue-bot prestashop-issue-bot bot removed the Ready Status: Issue is ready to be worked on label Dec 17, 2020
@marionf marionf added the Fixed Resolution: issue closed because fixed label Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.6.9 Affects versions 1.7.7.0 Affects versions BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Old Products Page Concerns the old product page Taxes and Prices Component: Which BO section is concerned Virtual Product type: issue about virtual products
Projects
No open projects
4 participants