I need to be able to limit how many of a certain product can be added to the cart.
I thought I could use {cart_items_info}
with an {entry_id}
parameter to limit to the product I'm targeting and then use a conditional based on {total_items}
, e.g.
{exp:cartthrob:cart_items_info entry_id="XXX"}
{total_items} {!-- returns the total of other items in the cart too, not just the entry_id specified --}
{if total_items <=5} … {/if}
{/exp:cartthrob:cart_items_info}
but the tag seems to return the whole cart total items regardless of whether I use the entry_id
param or not.
Is this a bug with cart_items_info
or is there another way I should be going about this?