How to pass variables from PHP to the browser in observer

by Bruno Koga   Last Updated April 19, 2018 14:09 PM

What I need to do is: When the event 'checkout_cart_save_after' is dispatched, get the cart data (sent in the event dispatch) with an observer.

Then i need to send this data to the browser (with JS) and be able to read it (get products, quantity and all stuff). Can anyone help me?

EDIT: I'm using Magento 2.1.

Related Questions

After Order Place Event is not Working

Updated January 03, 2018 14:09 PM

Event observer causes JSON error?

Updated September 11, 2017 15:09 PM

Event observer causes JSON error? [Part 2]

Updated September 12, 2017 10:09 AM

When to dispatch events in a custom module?

Updated May 21, 2016 08:03 AM