I'm trying to add a product from cart page through ajax, I need to require the default JS : 'Magento_Customer/js/customer-data' so that I can update the cart totals. But as soon as I place this code on my page :

function($, customerData, getTotals) {

I'm getting the error :

Cannot read property 'sectionLoadUrl' of undefined

Is there any way to fix this ? I tried to use 'domReady!' but it's not working.


Your Answer

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

Browse other questions tagged or ask your own question.