I am trying to add products in wishlist using ajax with phtml + Controller. However, the product gets added to wishlist but the counter of wishlist doesn't change.

Is there a way to trigger an update for wishlist counter.


Update your js file as

], function (...,customerData) {
   "use strict";
   var sections = ['wishlist'];
   customerData.reload(sections, true);

Modify above code according to your need and you will get what you need.

  • Thanks @user3313626, exactly what I wanted :) – Nausif Jan 11 '19 at 9:47

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.