Portal | Homepage | Blog

New NitroScript Tag: ns:getBasketItemCount


#1

New NitroScript Tag

As part of our ongoing effort to make customizing your store easier we have added a NitroScript tag that returns the number of items currently in your basket. It was always possible to loop over the basket to calculate this but, for the sake of shorter, clearer code, it is now possible to do this with a single call.

ns:getBasketItemCount

Example

To be absolutely clear, let us take an example: you have 2 apples and one orange in your basket. ns:getBasketItemCount will return 3.

Scope

The most obvious place to use this is in the cart panel but the tag is available on all the templates.