count cart items in magento 2 object manger code example
Example: magento 2 get number of cart items
$helper = $this->helper(\Magento\Checkout\Helper\Cart::class);
echo $helper->getSummaryCount()
$helper = $this->helper(\Magento\Checkout\Helper\Cart::class);
echo $helper->getSummaryCount()