Jump to content

Change cobobox to checkbox in the product display


mariem00

Recommended Posts

Hi all,

I would be gratful if you could help.

I'm trying to change the combobox in product.tpl into a checkbox for product attributes.

I replaced the code:

<select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
				{foreach from=$group.attributes key=id_attribute item=group_attribute}
					<option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option>
				{/foreach}
			</select>

by this code:

<input  name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">

				{foreach from=$group.attributes key=id_attribute item=group_attribute}
					<input type="checkbox" name="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="checked"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}" value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="checked"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}<br>
				{/foreach}

It doesn't work, and I don't know what to change in the product.js script.

Thanks.

Link to comment
Share on other sites

It won't work for you, as Prestashop does not allow the selection of more than one attribute from each group.

 

You could try to change it to a radio button, but if you need to allow for multiple selection from one group, have a look at this module http://www.prestashop.com/forums/topic/38061-module-attribute-wizard-customize-prestshop-attributes-control-the-group-and-item-order-add-group-images-descriptions-and-more/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...