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

add block with observer event

Updated April 15, 2015 03:03 AM




Cache file /home/queryxchang/public_html/apps/frontend/config/../cache/-q-10-223014-how-to-pass-variables-from-php-to-the-browser-in-observer- could not be written