Order summary items-in-cart update

by MadzQuestioning   Last Updated May 22, 2020 21:09 PM - source

I want to update the items in cart count in the checkout#payment sidebar. I have added a button that when clicked the items in cart will be added by one. So far the items in cart are updating correctly but the count in the Order summary not being displayed correctly. As seen in the image I want to update the count everytime I click the button as shown belowenter image description here

As you can see in the image there are 7 Items in Basket but when you check and count all items it should say 8 items in basket How can I update the 7 to make it 8? It seems that this is using the

text: getCartSummaryItemsCount()

I don't know how to update the count after the ajax call. Below is my code to update the sidebar but the count is not updating

/** @inheritdoc */
success: function (res) {  

   var sections = ['cart'];
   customerData.reload(sections, true);
   var deferred = $.Deferred();
   getTotalsAction([], deferred);
   cartCache.set('totals',null);
   defaultTotal.estimateTotals();
   $('body').trigger('processStop');
   return false;
}

Not sure how to update the count here. I'm doing the changes in the checkout payment page I want to update the count in the sidebar



Related Questions




How to use Knockout JS within Magento 2

Updated February 29, 2016 03:04 AM