Jump to content

[resolved] label on product image


axel31

Recommended Posts

Hello everybody,

I want to add a label on the product image on product pages and product list pages, like le label "new" for example. The content of this label must be the name of an attribute from an attribute family I have specially created ("Particularité").

I managed to do it on the product page by adding the following code in product.tpl :

{if isset($groups)}
  {foreach from=$groups key=id_attribute_group item=group}
    {if $group.name =='Particularité'}
      <span class="bandeausup1-box">
        <span class="bandeausup1-label">
          {foreach from=$group.attributes key=id_attribute item=group_attribute}
            <span>{$group_attribute|escape:'html':'UTF-8'}</span>
          {/foreach}
        </span>
      </span>
    {/if}
  {/foreach}
{else} 
  <span class="bandeausup1-box" style="display:none"></span>
{/if} 

My problem is that code doesn't work on product-list.tpl. Could someone explain me how to make it work?

Thanks a lot.

Edited by axel31
Code readability (see edit history)
Link to comment
Share on other sites

  • 1 month later...

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