View Single Post
  #2  
Old 05-13-2008, 12:30 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Subcategory Icon

Quote:
Originally Posted by yuichi
Hi All.
I am having a hard time figuring this out...
I was able to show the Subcategory Icon with this thread...
http://forum.x-cart.com/showthread.php?t=3848&page=22&highlight=subcategor ies+icons

Subcategory Icon shows on the Category page with bunch of Subcategory icons, but when I click on the specific Subcategory to go to that Subcategory page, then icon dissapears.

I added
Code:
<img src="{$subcat.icon_url}" alt="" />

at the beginning of the subcategories.tpl , but no luck..

Any help much appreciated....


Try used this code for subcategories.tpl.

Option:
{assign var="count_per_row" value=3} (3 - count column)
<img src="{$c.icon_url}" width=200> (200px - image width)


PHP Code:
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}
<
/>
{include 
file="modules/Bestsellers/bestsellers.tpl"}
{/if}
<
/>
{if 
$active_modules.Special_Offers}
{include 
file="modules/Special_Offers/customer/category_offers_short_list.tpl"}
{/if}
{if (
$navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}</>{/if}
{
capture name=dialog}
{
assign var="tmp" value="0"}
{foreach 
from=$subcategories item=c key=catid}
{if 
$c.category}{assign var="tmp" value="1"}{/if}
{/foreach}
{if 
$subcategories}
<
table   width="100%">
{
assign var="count_per_row" value=3}

{
math equation="floor(100/x)" x=$count_per_row assign="width"}
{
assign var="count" value=0}

{foreach 
from=$subcategories item=c key=catid}

        {if 
$count is div by $count_per_row}
            <
tr>
            {
assign var="count" value=0}
        {/if}

        <
td align=center valign=top>

        <
table border=0>
            <
tr>
                <
td align=center valign=top><a href="home.php?cat={$catid}class="VertMenuItems">
                {if 
$c.icon_url ne ""}<img src="{$c.icon_url}width=200>
                {else}
                <
img src="image.php?type=C&id=0&ts=" width=125>                
                {/if}</
a></td>
            <
tr>
            <
tr>
                <
td align=center><font class="CategoriesList"><a href="home.php?cat={$catid}class="VertMenuItems">{$c.category}</a></font></td>
            </
tr>
            {*<
tr>
                <
td align=center>{$c.description}</td>
            <
tr>*}

        </
table>

        </
td>

        {
capture name=prod_index}
            {
math equation="index+x+1" index=$count x=$count_per_row}
        {/
capture}
        
        {if 
$smarty.capture.prod_index is div by $count_per_row}
            </
tr>
        {/if}
        {
math equation="x+1" x=$count assign="count" }

{/foreach}

    {if 
$count lt $count_per_row}
    {
section name=rest_cells loop=$count_per_row start=$count}
        <
td class="SectionBox">&nbsp;</td>
    {/
section}
    {/if}
</
tr>
 
</
table>
{/if}
{if 
$tmp and $products ne "" }
<
br clear="left" />
<
hr size="1" noshade="noshade" />
{/if}
{if 
$products}
{if 
$sort_fields}
<
div align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction url="home.php?cat=`$cat`&"}</div>
{/if}
{if 
$total_pages gt 2}
<
br />
{ include 
file="customer/main/navigation.tpl" }
{/if}
<
hr size="1" width="100%" />
{include 
file="customer/main/products.tpl" products=$products}
{/if}
{if 
$products eq "" and $tmp eq "0"}
{
$lng.txt_no_products_in_cat}
{/if}
{/
capture}
{include 
file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra='width="100%"'}
{if 
$products eq ""}
{if 
$f_products ne ""}
<
/>
{include 
file="customer/main/featured.tpl"}
{/if}
{/if}
{ include 
file="customer/main/navigation.tpl" 
Reply With Quote