Bonjour,
J’ai enfin trouvé comment ne faire apparaitre qu’un texte à la place d’une liste déroulante lorsque qu’un groupe d’attribut ne comporte qu’un seul attribut, ceci pour permettre de donner une information capitale sur un produit sans passer par les caractéristiques
Donc dans product.tpl vous devez remplacer :
<!-- attributes -->
<div id="attributes">
{foreach from=$groups key=id_attribute_group item=group}
<p>
<label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
{assign var='groupName' value='group_'|cat:$id_attribute_group}
<select name="{$groupName}" id="group_{$id_attribute_group|intval}">
{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}
</select>
</p>
{/foreach}
par :
<!-- attributes -->
<div id="attributes">
{foreach from=$groups key=id_attribute_group item=group}
<p>
<label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
{assign var='groupName' value='group_'|cat:$id_attribute_group}
{if count($group.attributes) > 1}
<select name="{$groupName}" id="group_{$id_attribute_group|intval}">
{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}
</select>
{else}
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<span class="editable">{$group_attribute|escape:'htmlall':'UTF-8'}</span>
{/foreach}
{/if}
</p>
{/foreach}





