3

I was seeing various errors on cart page of Magento 2.1.6.

Cannot read property "quoteData" of undefined (quote.js)
Cannot read property 'storeCode' of undefined (url-builder.js)
Cannot convert undefined or null to object (customer-addresses.js)

Incase someone else sees these errors, for me they were caused by removing certain blocks from checkout in XML.

<referenceBlock name="checkout.cart.shipping" remove="true"/>
<referenceBlock name="checkout.cart.coupon" remove="true"/>
<referenceBlock name="checkout.cart.crosssell" remove="true"/>
<referenceBlock name="checkout.cart.order.actions.gift_options" remove="true"/>

I fixed by re-inserting blocks and hiding relevant sections with css.

4

For my case it was this block

<referenceBlock name="checkout.cart.shipping" remove="true"/>

I removed that line and I overwrote shipping.phtml on my theme to remove the shipping address and to keep the checkoutConfig and the JavaScript. It's totally stupid to include the script in a part of the view and depend on it on other parts. Just like the rest of everything stupid with Magento

  • 5
    +1 Just like the rest of everything stupid with Magento – shashwat May 15 '18 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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