Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Product Options with Checkbox has 2 checkboxes in list Rate Topic   - - - - -

 
  • TVC
  • Member
  • Members
  • Join Date: 16-Jan 06
  • 54 posts

Posted 19 January 2006 - 04:37 AM #1

visiting this page on my site:
index.php?target=categories&category_id=xxx

shows this:

Posted Image

There are 2 checkboxes, the first seems to do nothing, it doesn't add the option to the product in the shopping cart. The further right one works as expected.

When you click on the product to see the full description, it looks fine with one checkbox for that option (index.php?target=products&product_id=xx):


Posted Image

 
  • zeke
  • Megamind
  • Administrators
  • Join Date: 01-Nov 05
  • 472 posts

Posted 19 January 2006 - 09:51 AM #2

To fix it, find the template "skins/skin_name/customer/products_pages/product_options_advanced.tpl" and replace the following code:
	{elseif $po.option_type == "C"} {* CHECK BOX *}
		{if $po.variants}
   		<table cellpadding="0" cellspacing="0" border="0">
   		<tr>
   			{foreach from=$po.variants item="vr" name="vars"}
	   		<td><input type="checkbox" name="products_to_add[{$key}][product_data][product_options][{$po.option_id}]" value="{$vr.variant_id}" {if $po.value == $vr.variant_id}checked{/if}></td>
   			<td>{$vr.variant_name}{if $vr.modifier|floatval}({include file="common_templates/modifier.tpl" mod_type=$vr.modifier_type mod_value=$vr.modifier}){/if}</td>
   			<td></td>
	   		{/foreach}
   		</tr>
   		</table>
		{else}
		<input type="checkbox" name="products_to_add[{$key}][product_data][product_options][{$po.option_id}]" value="Y" {if $po.value == 'Y'}checked{/if}>
		{/if}

with
	{elseif $po.option_type == "C"} {* CHECK BOX *}
		{if $po.variants}

		{foreach from=$po.variants item="vr"}
		{if $vr.position == 0}
			<input type="hidden" name="products_to_add[{$key}][product_data][product_options][{$po.option_id}]" value="{$vr.variant_id}">
		{else}
			<table cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td>
					
					<input type="checkbox" name="products_to_add[{$key}][product_data][product_options][{$po.option_id}]" value="{$vr.variant_id}"></td>
				<td>{if $vr.modifier|floatval}({include file="common_templates/modifier.tpl" mod_type=$vr.modifier_type mod_value=$vr.modifier}){/if}</td>
				<td></td>
			</tr>
			</table>
		{/if}
		{/foreach}		

		{/if}


 
  • TVC
  • Member
  • Members
  • Join Date: 16-Jan 06
  • 54 posts

Posted 19 January 2006 - 01:46 PM #3

Man you guys are fast! Thanks! Worked great!