Open MarcProvi opened 1 year ago
Hi @MarcProvi. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. @magento give me 2.4-develop instance
Hi @okolesnyk. Thank you for your request. I'm working on Magento instance for you.
Hi @okolesnyk, here is your Magento Instance: https://a1f49fe434ce563ccd915703c1656256.instances-prod.magento-community.engineering Admin access: https://a1f49fe434ce563ccd915703c1656256.instances-prod.magento-community.engineering/admin_99e9 Login: 51fdcd6c Password: 58ad18c6a855
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hello @MarcProvi,
Thank you for the report and collaboration!
Can you please elaborate the 4th step in Preconditions, and what exactly you mean by the affected website. This will help us to reproduce the issue more effectively. It would be great if you can provide sample code, or screencast for the reference.
Thank you.
With the 4th Step of preconditions I mean that two tier prices exist with the same information but with different websites, as the image of steps to reproduce shows.
So for example in the tier prices will be: Tier Price 1:
Tier Price 2:
The only data difference between the two tier prices is the website they are assigned to, the other data is exactly the same.
The problem is that the delete tier price storage function checks all the fields despite the website ID before deleting the tier price, so if two tier prices match all the other fields but with different website, the tier price storage function will retrieve only the first result of the tier prices and not both IDs when trying to delete both tier prices.
An example of use would be that you want to delete all tier prices of a specified product. When retrieving all tier prices of the product and using the tier price storage interface to delete all tier prices, all tier prices should be deleted, but in reality only the first tier price is deleted and the other not.
Hello @MarcProvi,
Thank you for the quick response!
We followed your inputs and the issue seems to be reproducible on 2.4-develop. We created a custom module to delete the tier price after opening the specific route. Please take a look at the screenshots:
Here we have created same tier prices for two different website.
After using the price storage interface to delete the tier prices we got below result. We can see here that only one tier price has been deleted, hence confirming the issue.
Please find the custom module used to reproduce the issue. TierVendor.zip
Thank you.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-9738 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
:x: You don't have permission to export this issue.
Preconditions and environment
Steps to reproduce
Tier Prices should look like this:
Expected result
All Tier prices are deleted.
Actual result
Only the first tier price that match the conditions is deleted, because it doesn't take into account the website of the tier price.
Additional information
The problem is found in \Magento\Catalog\Model\Product\Price\TierPriceStorage.php where the function delete doesn't retrieve correctly the affected IDs to delete. The function retrievePriceId (Line 267) is the culprit of the bug with the current code: ` /**
@return int|null */ private function retrievePriceId(array $price, array $existingPrices): ?int { $linkField = $this->tierPricePersistence->getEntityLinkField();
}`
But the correct way of retrieving the price Id should be: ` /**
@return int|null */ private function retrievePriceId(array $price, array $existingPrices): ?int { $linkField = $this->tierPricePersistence->getEntityLinkField();
}`
With this fix the retrieve price ID takes into account the website the tier price is created and makes a unique identifier of the tier price with all the previous information.
Release note
No response
Triage and priority