Skip to content

"cart" section data gets loaded 3 times on cart page (2.2.2) #13765

@erikhansen

Description

@erikhansen

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.

Preconditions

  1. Install Magento 2.2.2 with sample data

Steps to reproduce

  1. Add any product to cart
  2. Go to cart page /checkout/cart with the "Network" panel open in DevTools.

Expected result

  1. The /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:
https://magento22.dev/customer/section/load/?sections=&update_section_id=false&_=1519190370042
https://magento22.dev/customer/section/load/?sections=directory-data&update_section_id=false&_=1519190370043

Actual result

  1. The /customer/section/load url will get called four times:
https://magento22.dev/customer/section/load/?sections=&update_section_id=false&_=1519190370042
https://magento22.dev/customer/section/load/?sections=directory-data&update_section_id=false&_=1519190370043
https://magento22.dev/customer/section/load/?sections=cart&update_section_id=false&_=1519190370045
https://magento22.dev/customer/section/load/?sections=cart&update_section_id=false&_=1519190370046

Note: if you refresh the cart, there will only be two calls made to /customer/section/load.

23-27-41 shopping cart-4cloy

Some more info, to help the developer that reviews this issue: When reviewing XHR requests, it's helpful to understand what initiated those requests:

23-30-55 shopping cart-neuqj

Here are the contents of the call stacks for each of the bottom two requests:

send | @ | jquery.js:10254
-- | -- | --
  | ajax | @ | jquery.js:9738
  | jQuery.(anonymous function) | @ | jquery.js:9890
  | getJSON | @ | jquery.js:9871
  | getFromServer | @ | customer-data.js:89
  | reload | @ | customer-data.js:329
  | initialize | @ | minicart.js:104
  | (anonymous) | @ | wrapper.js:109
  | UiClass | @ | class.js:49
  | initComponent | @ | layout.js:137
  | fire | @ | jquery.js:3232
  | fireWith | @ | jquery.js:3362
  | deferred.(anonymous function) | @ | jquery.js:3461
  | fire | @ | jquery.js:3232
  | fireWith | @ | jquery.js:3362
  | deferred.(anonymous function) | @ | jquery.js:3461
  | (anonymous) | @ | layout.js:120
  | execCb | @ | require.js:1650
  | check | @ | require.js:866
  | (anonymous) | @ | require.js:1113
  | (anonymous) | @ | require.js:132
  | (anonymous) | @ | require.js:1156
  | each | @ | require.js:57
  | emit | @ | require.js:1155
  | check | @ | require.js:917
  | (anonymous) | @ | require.js:1113
  | (anonymous) | @ | require.js:132
  | (anonymous) | @ | require.js:1156
  | each | @ | require.js:57
  | emit | @ | require.js:1155
  | check | @ | require.js:917
  | (anonymous) | @ | require.js:1113
  | (anonymous) | @ | require.js:132
  | (anonymous) | @ | require.js:1156
  | each | @ | require.js:57
  | emit | @ | require.js:1155
  | check | @ | require.js:917
  | enable | @ | require.js:1143
  | init | @ | require.js:774
  | callGetModule | @ | require.js:1170
  | completeLoad | @ | require.js:1544
  | onScriptLoad | @ | require.js:1671

and

send | @ | jquery.js:10254
-- | -- | --
  | ajax | @ | jquery.js:9738
  | jQuery.(anonymous function) | @ | jquery.js:9890
  | getJSON | @ | jquery.js:9871
  | getFromServer | @ | customer-data.js:89
  | reload | @ | customer-data.js:329
  | (anonymous) | @ | totals.js:26
  | execCb | @ | require.js:1650
  | check | @ | require.js:861
  | enable | @ | require.js:1143
  | init | @ | require.js:774
  | callGetModule | @ | require.js:1170
  | completeLoad | @ | require.js:1544
  | onScriptLoad | @ | require.js:1671

Metadata

Metadata

Assignees

Labels

Component: ConsoleFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions