Jump to content

Product attributes - way to not have drop down with only 1 option?


Recommended Posts

Hello,

 

Some of my products have several attributes you can select, so a drop-down is desireable. However, some products only have one attribute possible (which is useful when the customer is searching with the "Product list attributes" module), so is it possible to only display text instead of the drop-down for the attribute area?

 

Thanks

-Jay

Link to comment
Share on other sites

by default it isn't possible, you can do it only with modification of the product.tpl file foreach loop: {foreach from=$groups key=id_attribute_group item=group}

 

all that you have to do is to check number of available attributes with if condition if number == 1 display hidden field <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select"> with value="{$id_attribute|intval}" 

 

hope it is clear :)

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...