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)
-   -   Subcategories Icon (https://forum.x-cart.com/showthread.php?t=6378)

trickdog101 02-23-2004 09:15 AM

Subcategories Icon
 
I am looking for some information that I thought I saw on here before.

Basically what I am trying to do is this...

I have category listings down the side of the page. When a customer clicks on the category listings, the main body of the page is populated with a textual listing of the subcategoires.

What I would like to do is modify the the customer/main/subcategories.tpl file so that instead of using text to list the subcat, it uses the subcat's icon.

Also, I would like to list them in three columns across.

Thanks for the help

Trick Dog!

finestshops 02-27-2004 07:56 PM

Re: Subcategories Icon
 
Quote:

Originally Posted by trickdog101
Also, I would like to list them in three columns across.


Try this for "subcategories.tpl"

Code:

{* $Id: subcategories.tpl,v 1.29 2002/11/26 14:55:13 alfiya Exp $ *}
{ include file="location.tpl" }
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}


 
{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}


 
{ include file="customer/main/navigation.tpl" }
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":"
"}

{/if}


{capture name=dialog}
{assign var="tmp" value="0"}

{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}

{section name=cat_num loop=$subcategories}

{ if %cat_num.first% }
<table border=0 cellspacing=5 width=100%>
{/if}

  {if $smarty.section.cat_num.index is div by 2}
    </tr><tr valign="top">
  {/if}

        <td valign="top" width="70" align="center">
        <a class="alt" href="home.php?cat={ $subcategories[cat_num].categoryid }">
        [img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]
        </a>
        </td>
        <td align=left><a class="alt" href="home.php?cat={ $subcategories[cat_num].categoryid }">
        {$subcategories[cat_num].category|escape}</a>

        { $subcategories[cat_num].description|escape }
{if $config.Appearance.count_products eq "Y"}


<font class=Text>
{if $subcategories[cat_num].product_count}
{ $subcategories[cat_num].product_count } {$lng.lbl_products}
{elseif $subcategories[cat_num].subcategory_count}
{ $subcategories[cat_num].subcategory_count } {$lng.lbl_categories|lower}
{/if}
</font>
{/if}


        </td>

{ if %cat_num.last% }
</tr></table>
{/if}

{/section}
{if $tmp and $products ne "" }
<br clear=_all>{*<hr size=1 noshade>*}
{/if}

{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}




{include file="customer/main/products.tpl" products=$products}

{/capture}
{include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" 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" }


you can see it in action here:

http://www.bitsnspurs.com/store/customer/home.php?cat=13

if you need 3 columns chnage
Code:

div by 2
to
Code:

div by 3

trickdog101 03-02-2004 05:53 AM

Thanks a bunch! That did it!

www.outhousemall.com

skyking 04-24-2004 12:47 PM

Thank you.

mream 10-05-2004 02:25 PM

Doesn't that code remove the "x products" or "x categories" count on the right-hand side? Is there an easy way to combine graphic and count?

mream 10-07-2004 10:03 AM

anyone?

finestshops 10-07-2004 10:42 AM

Quote:

Originally Posted by mream
Doesn't that code remove the "x products" or "x categories" count on the right-hand side? Is there an easy way to combine graphic and count?


I updated the code above to show products or category counts after category description. I did not have a chance to test it.

mream 10-08-2004 09:06 AM

That worked. I made some format changes, and moved some stuff around, but it worked as posted and you can see it here, with my changes:

http://www.raiseyourpulse.com/customer/home.php?cat=262

TheComputerGuy 10-12-2004 05:55 AM

Ok, this is exactly what i've been looking for! But there is something i don't get in regrads to have sub-category icons:

How do I get the Icons to show for each sub category? I notied the code went like this:
Code:

[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]

But i have no idea where i put the icon images and how i link them to that img src (../icon.php?categoryid={$subcategories[cat_num].categoryid})?

If i'm missing something, can someone please feel me in. Thank you

finestshops 10-12-2004 02:36 PM

Quote:

Originally Posted by TheComputerGuy
How do I get the Icons to show for each sub category? But i have no idea where i put the icon images


You can assign icon to each category in "Categories" interface.
If you are using v4.X.X you will have to change

Code:

<img src="../icon.php

to

Code:

<img src="icon.php


All times are GMT -8. The time now is 11:55 PM.

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