X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Subcategories with images (https://forum.x-cart.com/showthread.php?t=5505)

Light Speed 12-07-2003 12:39 PM

Subcategories with images
 
When a user clicks on a category they get a list of subcategories but I would like for each list item(subcategory) to have it's own image with the linktext underneath like this:

Link to example

What tpl files need to be edited and what would the code be to allow this?

funkydunk 12-30-2003 04:11 AM

customer/main/subcategories.tpl would need to be changed.

The code is:

Code:

{section name=cat_num loop=$subcategories}
{assign var="tmp" value="1"}
{ if %cat_num.first% }
<table border="0" cellspacing="0" cellpadding="5" width="100%">
{/if}
{ if %cat_num.index% is div by 3}
<tr>
{/if}
<td>
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]


{ $subcategories[cat_num].category|escape }</a>
</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}


This is adapted from my own site, so feel free to jazz it up to what you need :)

Light Speed 12-30-2003 10:51 AM

Thanks funkydunk! :)


All times are GMT -8. The time now is 03:06 PM.

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