cart using checkbox on attribute
Posted: Tue Oct 05, 2010 6:35 pm
I have developed a complet ecommerce site
I want to have a checkbox in only items that have a second attribute set.(gift wrapped) This will always be the second attribute.
I used
{if isset($attribute_count) && $attribute_count gt 1}
giftwrapped
{/if}
But cannot seem to get the javascript to work. What I want to happen when they click the checkbox the second attribute selected index=1 and when they untick the box the selected index =0
The attributes are hidden by using a div in thecart template as below
{* add to cart template *}
{$formstart}
{if isset($attribute_count) && $attribute_count gt 0}
{foreach from=$attributes item='attrib'}
{$attrib->name}: {$attrib->control}
{/foreach}
{/if}
{if isset($attribute_count) && $attribute_count gt 1}
Gift Wrapped
{/if}
{$formend}
I do not want to use a dropdown but a checkbox
I want to have a checkbox in only items that have a second attribute set.(gift wrapped) This will always be the second attribute.
I used
{if isset($attribute_count) && $attribute_count gt 1}
giftwrapped
{/if}
But cannot seem to get the javascript to work. What I want to happen when they click the checkbox the second attribute selected index=1 and when they untick the box the selected index =0
The attributes are hidden by using a div in thecart template as below
{* add to cart template *}
{$formstart}
{if isset($attribute_count) && $attribute_count gt 0}
{foreach from=$attributes item='attrib'}
{$attrib->name}: {$attrib->control}
{/foreach}
{/if}
{if isset($attribute_count) && $attribute_count gt 1}
Gift Wrapped
{/if}
{$formend}
I do not want to use a dropdown but a checkbox