To get number of cart items in Magento e.g. to display in the mini-cart or header of your Magento e-commerce…