1

Since I was planning to have "You have # items in the cart". Is it possible to get the number of items in the cart?

I tried to do something like this:

{exp:store:cart}

You have {if no_items}0{if:else}{items}{/if} item(s) in the cart 

{/exp:store:cart}

1 Answer 1

2

You need {order_qty}.

{exp:store:cart}

    {if no_items}Your cart is empty.{/if}

    You have {order_qty} item(s) in the cart.

{/exp:store:cart}

:)

3
  • ahh thanks. I tried with {item_qty} and I guess I got confused.
    – mirko
    Mar 29, 2013 at 19:25
  • The Store guys have thought of most things so there's usually a tag to cover most situations. :) Don't forget to mark this answer up if it helped. :)
    – Ian Young
    Mar 29, 2013 at 19:35
  • Just fixed your code up a little bit - the {if no_items} tag works the same way as {if no_results}, if it is true then nothing else will be displayed. Mar 30, 2013 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.