magento2
magento2 copied to clipboard
Bundle product price indexing not calculating tier prices correctly
Preconditions (*)
- Magento version 2.x (appears to have been present in all versions)
- Magento 2.4-develop
Steps to reproduce (*)
- Create a bundle product with a fixed price - e.g. $100
- Apply a tier price discount for all websites and all customer groups of 10%
- Run
bin/magento indexer:reindex catalog_product_price
Expected result (*)
- Final price (and min_price, max_price, tier_price) in
catalog_product_index_priceare set to 90 (100 - 10%)
Actual result (*)
- Final price (and others) in
catalog_product_index_priceare set to 100
Additional Information
https://github.com/magento/magento2/issues/30610#issuecomment-716775736
I have debugged this issue locally, and it appears to be caused by this line:
https://github.com/magento/magento2/blob/a1e5689cc6092e40e1ebb975f4eaae32c4d8d1e5/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php#L679
This is getting the minimum value of catalog_product_entity_tier_price.value, but due to:
https://github.com/magento/magento2/blob/a1e5689cc6092e40e1ebb975f4eaae32c4d8d1e5/app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php#L82
There is no fixed price option for bundle products in the advanced pricing modal. Instead, all values are percentage discounts, which populates the catalog_product_entity_tier_price.percentage_value column.
I have patched \Magento\Bundle\Model\ResourceModel\Indexer\Price.php locally to change MIN(tp.value) to MIN(tp.percentage_value), and I then saw the expected values populated in catalog_product_index_price.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [x] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @aligent-lturner. Thank you for your report. To help us process this issue please make sure that you provided the following information:
- Summary of the issue
- Information on your environment
- Steps to reproduce
- Expected and actual results
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance - upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @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, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-Delta. 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:
-
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is validwill be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is validappears. -
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Descriptionlabel to the issue by yourself. -
[ ] 3. Add
Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to. -
[ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! -
[ ] 5. Add label
Issue: Confirmedonce verification is complete. -
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @aligent-lturner thank you for your report. Looks like bundle product price is displayed correctly on catalog page and product detail page. Manual testing scenario:
- Create bundle product with simple product as option

- Set tier price in Advanced Pricing tab for bundle product
Run bin/magento indexer:reindex catalog_product_priceand flush cache Go to storefront catalog page Result: :heavy_check_mark: Price is shown with discount correctly:100 - 100*0.1 = 90without option
:heavy_check_mark: Price is shown with discount correctly: 100 - 1000.1 + 100 - 1000.1 = 180` with option

Bundle product price in database:

Could you provide additional information how bundle product was created and clarify issue with tier price as on storefront it is calculated correct?
@engcom-Delta the price is displayed correctly on the storefront because it's calculated again. The issue is that the price in the catalog_product_index_price table is incorrect - as shown in your screenshot above, the price is given as 100 instead of 90.
For most people, this is not going to cause a problem, as the price is recalculated on Catalog pages and when adding to cart, etc., Which is probably why this issue hasn't been picked up before. If you are getting data directly from the index table, however (for example to use in an integration - sending pricing data to another system), then it is not correct.
:white_check_mark: Confirmed by @engcom-Delta
Thank you for verifying the issue. Based on the provided information internal tickets MC-40254 were created
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!
This is only stale because nobody has worked on it - it's still an issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 28 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!
Still an issue - just commenting to keep it open.
Hi @aligent-lturner,
Thanks for your reporting and collaboration.
We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.
Final price (and others) in catalog_product_index_price are set to 100
Hence Confirming the issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12312 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
We also had same issue in one of our project. This simple mr should fix the issue. https://github.com/magento/magento2/pull/40057