PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

 

[Tips] Remplacer liste déroulante pour attribut unique

1 reply to this topic
#1
jeckyl

    PrestaShop Legend

  • Freelance agréé
  • 10485 posts
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 -->

{foreach from=$groups key=id_attribute_group item=group}



{assign var='groupName' value='group_'|cat:$id_attribute_group}


{/foreach}


par :

<!-- attributes -->

{foreach from=$groups key=id_attribute_group item=group}



{assign var='groupName' value='group_'|cat:$id_attribute_group}
{if count($group.attributes) > 1}

{else}
{foreach from=$group.attributes key=id_attribute item=group_attribute}
{$group_attribute|escape:'htmlall':'UTF-8'}
{/foreach}
{/if}


{/foreach}

PrestatoolBox, la boite à outil pour Prestashop (Modules, Templates, Services)

Prestatools, l'annuaire des contributions

#2
BVince

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1091 posts
Impecable ;-)
http://www.cc-web.fr...nce_userbar.png
Home CategoriesMegaDrown EvolutionAnimation 3D
Retrouvez tous mes modules Prestashop ici