Jump to content

display image in left column only on products of same category


Recommended Posts

Hi,

 

Please excuse me if this has already been addressed, although I have looked and I cannot find exactly where I am going wrong.

 

I want an image/advert to appear in the left column of a product page, BUT only on products of a particular category. I want a different image/advert to display in the left column for products of a different category.

 

 

As it stands I can get adverts to appear on different products pages by calling their specific product ID ($id_product). Using a simple if & ifelse statement I can also have different adverts on different product pages. However, I want to find a product's category ID or parent category ID and display the advert in the left hand column of all products from a particular category?

 

I have the following code in my 'columnadverts.tpl' page:

 

{$product->id_category_default}

{if $page_name == 'product' && [spam-filter]$id_product == '1003'} || {$id_product == '1005'[spam-filter]}

 

<div>

 

<tr>

<td width="" height="" class="title"><img src="http://advert1.jpg" width="" height="" /></td>

 

</div>

 

{elseif {$id_product == '414'} || {$id_product == '986'[spam-filter]

 

 

<div>

 

<tr>

<td width="" height="" class="title"><img src="http://advert2.jpg" width="" height="" /></td>

 

</div>

{/if}

 

 

 

I appreciate any help in advance!

Link to comment
Share on other sites

×
×
  • Create New...