Sending Cart Information to the Header

I am trying to implement a unit quantity notifier in the header, that displays the number of items currently in the cart. I have set up two successful services, one that sends data to the header when there is a HeaderPageletLoadedEvent, and the other to pull data from the cart when there is a CartChangedEvent.

The issue is that I cannot seem to save the event / page details of the Header during the CartChangedEvent, and vice versa, as these seem to access the service page independently of each other. As a result, I am not sure how I am supposed to send the cart content information to the header.

Any ideas on how to do this?

The number of card items should be available in the frontend. Why don’t you use twig to output them?

Yes I had seen that code, but it was not displaying, and I was not able to access certain data from the header dump so I assumed it was not working. Removing the class name displayed the cart quantity (although not an accurate one; the amount of individual products were counted, and not the quantity of each product)

In the worst case check out more invasive stuff like OnGenericPageLoaded (only if necessary), it practically catches everything.