Description
Preconditions and environment
- Magento version : 2.4.5 EE
- Anything else that would help a developer reproduce the bug
Steps to reproduce
Add a product to cart using a graphql request
Expected result
Billing address should not be used to collect totals
Actual result
Billing address is to collect totals and because it's a billing, it's totals will always return no charges which is a waste of execution time.
Additional information
In vendor/magento/module-quote/Model/Quote/TotalsCollector.php
collect
method
Why foreach ($quote->getAllAddresses() as $address) {
?
Using $quote->getAllAddresses()
will return all adresses including billing. In this case why the billing is usefull to collect totals ?
We could not use here $quote->getAllShippingAddresses()
?
We can see in the bellow example there is 2 executions of collectAddressTotals
(one for my billing and one for my shipping). It could optimise the add to cart process to make this changes.
Release note
No response
Triage and priority
- 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.
- 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”.