syrovidis Posted October 27, 2010 Posted October 27, 2010 Hello,another question. How to disable SELECT tag in attributes, when attribute has just one value? I use attributes also for attributes filter search and I need to set them even if they have just one value. Disabling of SELECT tags of these attributes would be a good solution for me.Thank you for help. Share this post Link to post Share on other sites More sharing options...
rocky Posted October 28, 2010 Posted October 28, 2010 It's the following on lines 236-253 of product.tpl (in PrestaShop v1.3.2) that you will need to change: {if isset($groups)} <!-- attributes --> {foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count} {$group.name|escape:'htmlall':'UTF-8'} : {assign var='groupName' value='group_'|cat:$id_attribute_group} 0}$('#resetImages').show('slow');{/if}"> {foreach from=$group.attributes key=id_attribute item=group_attribute} {$group_attribute|escape:'htmlall':'UTF-8'} {/foreach} {/if} {/foreach} {/if} To hide attribute groups with only one item, you could change line 241 to: or to disable the dropdown, add the following before the > at the end of the select on line 244: {if $group.attributes|@count == 1} disabled="disabled"{/if} Share this post Link to post Share on other sites More sharing options...
syrovidis Posted October 28, 2010 Posted October 28, 2010 Ooh, it's easy :-) Super, thank you! Share this post Link to post Share on other sites More sharing options...
rocky Posted October 28, 2010 Posted October 28, 2010 If your issue is resolved, please edit your first post and add [sOLVED] to the front of the title. Share this post Link to post Share on other sites More sharing options...
synkro Posted April 13, 2011 Posted April 13, 2011 That is a good idea, but I don't know exaclty how to implement it on 1.4in my product.tpl I've got: {if $group.attributes|@count} {$group.name|escape:'htmlall':'UTF-8'} : {assign var="groupName" value="group_$id_attribute_group"} 0}$('#wrapResetImages').show('slow');{/if};"> {foreach from=$group.attributes key=id_attribute item=group_attribute} {$group_attribute|escape:'htmlall':'UTF-8'} {/foreach} {/if} {/foreach} But after replacing {if $group.attributes|@count} with any of the options above i get a blank product page. Share this post Link to post Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now