-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Area: PricingArea: ProductCDIssue recommended for the contribution dayIssue recommended for the contribution dayComponent: CatalogComponent: PricingEvent: Global-Contribution-DayIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressReported on 2.4.0Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.Affects critical data or functionality and forces users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Description
Preconditions (*)
- 2.4-develop or any previous version
Usage of \Magento\Catalog\Block\Product\ListProduct::getProductPrice
in app/code/Magento/Catalog/view/frontend/templates/product/list.phtml
or product boxes in widgets affects listing performance.
It calculates price for products again even if the values received from collection.
On the screenshot you can see that product items have price values.
Then when a product is rendered, magento starts to resolve the price
It does these steps:
- Looks for price renderer
- loads linked products for composite products
- Resolve price type (it already available from collection)
Because the prices already available from the collection it's enough to render formatted price value (amount and currency) [e.g. 10.00 $]. But magento loads prices again does comparations and then renders it. Even when sort by price used.
Steps to reproduce (*)
- Render price box from the product collection on listing or search pages
- Use simple or composite products
- See that price boxes consumes a lot of time for price rendering by calling
\Magento\Catalog\Block\Product\ListProduct::getProductPrice
in the loop
Expected result (*)
- Prices are rendered faster
- Redundant loads and price comparations in
ListProduct::getProductPrice
are eliminated ListProduct::getProductPrice
just formats given price float values. It does not resolve prices again- Moreover it does not load linked/child products
Actual result (*)
- Prices are rendered slowly
ListProduct::getProductPrice
loads extra price data and performs comparationsListProduct::getProductPrice
does not use data already available from collection, loads prices againListProduct::getProductPrice
loads child/linked products and performs redundant price resolve.
mrtuvn, nkajic, Tanguy-hthai, Nuranto, MTheProgrammer and 7 moremrtuvn and Nuranto
Metadata
Metadata
Assignees
Labels
Area: PricingArea: ProductCDIssue recommended for the contribution dayIssue recommended for the contribution dayComponent: CatalogComponent: PricingEvent: Global-Contribution-DayIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressReported on 2.4.0Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.Affects critical data or functionality and forces users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it