X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Product page show the category image (https://forum.x-cart.com/showthread.php?t=68499)

yamadan 01-19-2014 01:57 PM

Product page show the category image
 
Hi,
Been searching this forum and found a how to show the category name on the product page, but I can't find what to change to get the category image showing.

This is the code from another post on here for showing the category title in a product:

{if $location}
{foreach from=$location item=l name=location}
{if $smarty.foreach.location.index == $smarty.foreach.location.total - 2}
<div class="backtocat">
<div class="label">
<a href="{$l.1|amp}"><div class="icon"></div>{$lng.lbl_back_to} {$l.0}</a>
</div>
</div>
{/if}
{/foreach}
{/if}

Can anyone offer advice on what needs changing to show the category image on product page?

I have also tried attempts using the code in subcategories_t.tpl and failed...


Version 4.6

PhilJ 01-19-2014 02:44 PM

Re: Product page show the category image
 
A quick way...
Code:

<img src="image.php?type=C&id={$product.categoryid}">

yamadan 01-19-2014 03:59 PM

Re: Product page show the category image
 
Thanks for reply Phil, works well.

But if I wanted to use a different way so I can manually select which images show, in my home.tpl file I have the below,
how could I get to also show on products in that category?
...
{elseif $main eq "catalog" and $cat eq "273"}
<img...

Cheers


All times are GMT -8. The time now is 09:29 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.