Jump to content

how to disable drop-down attributes when there is a single value


Recommended Posts

Hi,

 

I'm using 1.3.2 & have been asked to modify the way the drop-down attribute menus display -

 

some items in the shop have attributes with only 1 value - these currently display as a drop-down menu with 1 option (which is selected)

 

I would like to either display single attribute options as plain text or to add "disabled" to the drop-down to prevent users from trying to select an option.

 

I know this sounds a bit crazy, but to change the way the shop has been setup would be a mammoth task.

 

I think the problem lies with the following product.tpl code:

 

{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}>{$group_attribute|escape:'htmlall':'UTF-8'}</option>

 

{/foreach}

 

Any help would be greatly appreciated.

 

Thanks,

 

Geoff.

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