We have products we give away free but you are only allowed to order one of each free item. I have removed the Quantity field from the Cart-AddToCart template but if you keep pressing the Add To My Cart button it will keep adding an additional item per click.
The Add To My Cart template is called from the Products Details template using:
Code: Select all
{cgecomm_form_addtocart product=$entry->id}Code: Select all
{* add to cart template *}
{if isset($cart_error)}
{cgerror}{$cart_error}{/cgerror}
{/if}
{$formstart}
{if isset($attribute_count) && $attribute_count gt 0}
{foreach from=$attributes item='attrib'}
{$attrib->name}: {$attrib->control}
{/foreach}
{/if}
<input type="submit" name="{$submitname}" value="{$addtocarttext}"/>
{$formend}What I would like to do is once someone adds one of the free items to their cart then the button is removed and a message stating the item has already been selected appear.
I have tried adding an
Code: Select all
{if $var > 0}DO THIS{/if}If you would like to see what I am up to you can visit:
http://103.18.108.3/~peogovau/index.php ... eturnid=61
The button is at the bottom of the page, once clicked it will take you to the cart page.
Please let me know if you need any more information or if I have posted in the wrong place, can't wait to learn what the solution is.
Thanks.

