1

Add to cart is not working and getting error:

section-config.js:33 Uncaught TypeError: Cannot read property '*' of undefined

I am very new to magento and by following docs, I have created a custom theme overriding the default LUMA theme.

And when i try to add a product to cart it shows Adding.. and loader keeps spinning.

I get following error in the console:

Uncaught TypeError: Cannot read property '*' of undefined
at Object.getAffectedSections (section-config.js:33)
at HTMLDocument.<anonymous> (customer-data.js:218)
at HTMLDocument.dispatch (jquery.js:5226)
at HTMLDocument.elemData.handle (jquery.js:4878)
at Object.trigger (jquery.js:5130)
at Object.jQuery.event.trigger (jquery-migrate.js:493)
at done (jquery.js:9858)
at XMLHttpRequest.callback (jquery.js:10311)

I tried flushing cache, deleting everything inside var folder and also changed url from http://localhost/dir-name to http://127.0.0.1/dir-name but no luck!

1 Answer 1

0

May be something with update section of mini cart has problem. If you are logged in as customer , it may also update some customer realted details. Check for custom modules related to cart and customer.

3
  • @gaurang I have not created any custom modules related to cart or customer!. anyways i will login as a customer and give a try. Jul 26, 2017 at 12:50
  • @user1296187 , Can please check weather you forget to include some js file in theme or something. It looks like some object can not readble by js. Jul 28, 2017 at 8:22
  • @GaurangPadhiyar thank you for your help, it was the below code in default.xml causing the problem <referenceContainer name="main"> <container name="content.top" label="Main Content Top"/> <container name="content" label="Main Content Area"/> <container name="content.aside" label="Main Content Aside"/> <container name="content.bottom" label="Main Content Bottom"/> </referenceContainer> Jul 28, 2017 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.