View Single Post
  #1  
Old 10-11-2007, 03:25 AM
 
ben@lrb.co.uk ben@lrb.co.uk is offline
 

Member
  
Join Date: Feb 2006
Posts: 29
 

Default Cart modification: how to hide option if product already in cart?

I've created a snippet of code to add a giftwrap option to the shopping cart (a hidden product, click to opt-in).

However, I want this NOT to show up if there is already giftwrap in the cart.

Obviously the basic structure I'm after is something like:

{if [cart contents] [does not contain] [product 3491]}

{include file="customer/main/gift_wrap.tpl"}

{/if}

but I'm not sure what variables to use in the if statement, or indeed, what expression Smarty uses for a "does not contain" match (so far I've just seen equals, not equals, greater than, less than etc. etc.)

Can anyone advise here?

Many thanks,

Rachael
__________________
--
X-cart Version 4.1.9
Reply With Quote