I have created a custom page with free text ordering functionality and called custom add to cart API to add items to the cart.

Once the item is added I need to update the cart item count with updated quantity. I tried to use

], function ($, getTotalsAction) {
    'use strict';

    var deferred = $.Deferred();
    getTotalsAction([], deferred);

But It is throwing error: Uncaught TypeError: Cannot read property 'quoteData' of undefined at quote.js:34


url-builder.js:12 Uncaught TypeError: Cannot read property 'storeCode' of undefined at url-builder.js:12

Anything missing here?

I referred Error javascript define magento2 : window.checkout.quoteData or store code are undefined which doesn't have any working solutions.

1 Answer 1


I was able to achieve this my the below code. It might help someone

    ], function (customerData) {
        var sections = ['cart'];
        customerData.reload(sections, true);

Your Answer

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

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