Jump to content

How do I add a product available colors in product-list.tpl


Recommended Posts

Hi, I've been trying to add colors available per product in product-list.tpl. For example, we have managed to defend each product manufacturer but I would like to display the colors available for each product.

I use 1.5 version of prestashop!

 

To add maker I used this code but it does not work for every product colors.

                <a href="{$link->getManufacturerLink($product.id_manufacturer)}"><img src="{$img_manu_dir}{$product.id_manufacturer}.jpg" alt="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" title="{$product.manufacturer_name|escape:'htmlall':'UTF-8'}" /></a>
               

Thanks and sorry for my English
The idea would be that:

post-977644-0-36112100-1428408588_thumb.jpg

 

culori.jpg

Edited by moraruvladut (see edit history)
Link to comment
Share on other sites

@dskarbek, can you help me with the line of code?

 

Thanks.

 

Download the files from 1.6 look at the code in product-list.tpl

I think it is this section
{if isset($product.color_list)}
<div class="color-list-container">{$product.color_list}</div>
{/if}

I'm not sure if $product.color_list is available in 1.5

Link to comment
Share on other sites

In product.tpl i have this for colors

 

{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
                                                <img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$colors.$id_attribute.name}" width="20" height="20" /><br>
                                            {/if}

 

but when i put this code in product-list.tpl don`t work.

Link to comment
Share on other sites

×
×
  • Create New...