Total Number of Items Field

As well as having the shopping cart summary in the first column, I want to have a little cart icon up in the corner showing the total number of items in the cart. The icon would link to the checkout page.

I figure I can do this by creating a custom template for a new block. That template would contain the image for the cart icon with a link to "/checkout". But what do I include to get the total number of items?

The field I want is in the existing shopping cart block with a class of "line-item-quantity-raw" - does that help me?

Posted: Oct 24, 2011


Aussiejen on October 26, 2011

If any one is interested. I figured this out. Bit of a rough solution but it works.

Created a view similar to the shopping cart block. Eliminated all the fields I didn't need and then used CSS to hide any extras I didn't want and to add the cart image.

craigkendall on January 31, 2012

My issue is that the number represented for items in the cart is off. Even after removing everything from the cart it still shows items in the cart.

Anyone have any ideas?

(I'm wondering if it relates to a special rule I created for shipping to calculate a $1 per item additional charge on one flat rate shipping method.)