Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Subcategories Icon

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-23-2004, 09:15 AM
 
trickdog101 trickdog101 is offline
 

Newbie
  
Join Date: Aug 2003
Posts: 6
 

Default 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!
Reply With Quote
  #2  
Old 02-27-2004, 07:56 PM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default 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
__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
  #3  
Old 03-02-2004, 05:53 AM
 
trickdog101 trickdog101 is offline
 

Newbie
  
Join Date: Aug 2003
Posts: 6
 

Default

Thanks a bunch! That did it!

www.outhousemall.com
Reply With Quote
  #4  
Old 04-24-2004, 12:47 PM
 
skyking skyking is offline
 

Member
  
Join Date: Mar 2004
Posts: 13
 

Default

Thank you.
Reply With Quote
  #5  
Old 10-05-2004, 02:25 PM
 
mream mream is offline
 

Advanced Member
  
Join Date: Apr 2004
Posts: 50
 

Default

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?
__________________
Matt
X-Cart Gold 4.0.11
Apache 1.3.29 (Unix)
PHP 4.3.4
Reply With Quote
  #6  
Old 10-07-2004, 10:03 AM
 
mream mream is offline
 

Advanced Member
  
Join Date: Apr 2004
Posts: 50
 

Default

anyone?
__________________
Matt
X-Cart Gold 4.0.11
Apache 1.3.29 (Unix)
PHP 4.3.4
Reply With Quote
  #7  
Old 10-07-2004, 10:42 AM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default

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.
__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
  #8  
Old 10-08-2004, 09:06 AM
 
mream mream is offline
 

Advanced Member
  
Join Date: Apr 2004
Posts: 50
 

Default

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
__________________
Matt
X-Cart Gold 4.0.11
Apache 1.3.29 (Unix)
PHP 4.3.4
Reply With Quote
  #9  
Old 10-12-2004, 05:55 AM
 
TheComputerGuy TheComputerGuy is offline
 

Member
  
Join Date: Aug 2004
Posts: 21
 

Default

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
__________________
Chris Dildy
Reply With Quote
  #10  
Old 10-12-2004, 02:36 PM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default

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
__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:22 PM.

   

 
X-Cart forums © 2001-2020