I've created a custom header that works fine. I replaced Magento's cart, and instead added a shopping basket icon in the header. Like so:
When pressed it redirects to the cart.
What I want to do is add the number if items in the users cart using JavaScript so that when a user pressed "add to cart" it also updates the number next to the bag showing how many items are in the basket.
I followed the suggestion here: Magento 2 Get Cart Quote Total in minicart.phtml
I placed <span data-bind="html: getCartParam('subtotal')"></span>
in the HTML but got an error getCartParam is undefined
Any ideas where I'm going wrong?