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
magento/magento2#13765 Excess requests 'customer data' on checkout cart page were fixed #14314
magento/magento2#13765 Excess requests 'customer data' on checkout cart page were fixed #14314
Conversation
…ere fixed: - Excess request for 'directory-data' was fixed; - Excess requests for 'cart' were fixed.
….2.2): - Blank line after variable declarations was added; - Blank line before "if" was added.
@@ -94,17 +94,17 @@ define([ | |||
this.isLoading(addToCartCalls > 0); | |||
sidebarInitialized = false; | |||
this.update(updatedCart); | |||
|
|||
if (cartData()['website_id'] !== window.checkout.websiteId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK this file is using not at checkout page only, so window.checkout will not be available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ihor-sviziev
I checked your comment.
window.checkout is available on home page and category pages.
Also, I want to tell you, that logic "cartData()['website_id'] !== window.checkout.websiteId" was earlier in Magento.
It was fixed it to remove excessed request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will review deeper little bit later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that window.checkout property exist at any page where present minicart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @sidolov
Please check and approve this PR.
Thanks for advance.
@magento-engcom-team give me new test instance |
Hi @ihor-sviziev, here is your new test Magento instance |
…page were fixed #14314
Hi @andrewbess. Thank you for your contribution. |
Hi @andrewbess
Would be great if you can adjust your changes to prevent this issue. Feel free to contact me if you have questions. Thanks, |
Hello @xmav |
Code changes has been reverted due to introduced issues |
@ihor-sviziev yes, it was reverted. |
@xmav |
Problem with this PR is that it probably works only then when you have to show prices excluding tax. when I update to from " So there should be added some check what is the admin setting - inclusive or exclusive tax and using proper value based on it. |
@xmav Is there an alternate to this fix? It is desperately needed. |
Description
The customer/section/load gets called 4 times when loading the cart for the first time. 3 of those times, cart data gets returned. On Magento 2.1, I believe only two calls are made to customer/section/load.
Fixed Issues (if relevant)
Steps to reproduce
/checkout/cart
with the "Network" panel open in DevTools.Expected result
/customer/section/load
url should only get called twice. For example, these are the two urls that get called on a Magento 2.1 install:Actual result
/customer/section/load
url will get called four times:Note: if you refresh the cart, there will only be two calls made to
/customer/section/load
.Contribution checklist