0

I use the QuoteFactory in order to load the quote by id & add items. Then I save the quote & call $quote->setTotalsCollectedFlag(false)->collectTotals().
After that, I can see on the database that the quote item have been added & on the frontend I also see the right qty on the cart page, but the mini-cart on the header stays the same.
When I sign out & in again it gets updated.
*My guess is that I need to somehow force the customerData to reload on frontend (customerData.reload(['cart'])), but I don't know how/if it's possible to performs that on the server side...

enter image description here


-- Any idea?
Pini
  • 917
  • 8
  • 26
  • Are there any JS errors in the browser's console? – Mohit Kumar Arora Oct 07 '18 at 08:08
  • No, there are no JS errors on console. – Pini Oct 07 '18 at 09:07
  • I hope, this link should help you: https://magento.stackexchange.com/questions/98869/how-to-trigger-a-minicart-update-after-adding-to-cart – Mohit Kumar Arora Oct 07 '18 at 09:09
  • It won't work for my case since I'm not using AJAX, it's a pure server side process (more like a cron job) that updates the quote. I'll have to find a way to trigger that either from server side (hopefully) or by some sort of a workaround that will do that on frontend when the page loads. – Pini Oct 07 '18 at 09:17

0 Answers0