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

Mod for subcategories in columns with descriptions and icons

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #111  
Old 02-07-2006, 10:02 AM
 
Glowinafuse Glowinafuse is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 80
 

Default

okay, I need my subcats names to be under the image for 4.0.17... Not sure what I need to do for this version.

Can someone please help me.

thanks in advance,
__________________
Gold 4.1.11
www.houseoftropicals.com/store
Reply With Quote
  #112  
Old 02-09-2006, 09:16 AM
 
Glowinafuse Glowinafuse is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 80
 

Default

here is my code for the subcategories.tpl

please help please!!! I have not found out how to do it...

Code:
{* $Id: subcategories.tpl,v 1.29 2002/11/26 14:55:13 alfiya Exp $ *} {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=center><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" }

thanks in advance for the help...[/code]
__________________
Gold 4.1.11
www.houseoftropicals.com/store
Reply With Quote
  #113  
Old 02-11-2006, 06:16 AM
 
almenzies almenzies is offline
 

Advanced Member
  
Join Date: Nov 2005
Posts: 66
 

Default Subcategory description under link

Hi,

I'm trying to add the subcategory descriptions under the subcategory link on the category page, see:

http://www.bubblebathrooms.co.uk/Whirlpool-baths-p-1-c-243.html

Ideally I want the definition of a single ended bath to be next to the image and under the link "single ended baths" but I just can't seem to get the right code - would be most grateful for some guidance.

My current subcategories code is:
(I added the line " $subcategories[cat_num].description|escape}" to no avail:

{* $Id: subcategories.tpl,v 1.43.2.5 2004/12/01 15:15:49 mclap Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}

{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}
{if $active_modules.Special_Offers and $category_offers}



{include file="modules/Special_Offers/customer/category_offers_short_list.tpl}
{/if}
{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}
{if $subcategories}
<TABLE width="100%" border="0" cellspacing="5">
{foreach from=$subcategories item=subcat}
<TR>
{* SAFETYNET DSEFU MOD *}
{if $enable_seo_links == "Y"}
<TD align="left" nowrap width="40%">[img]{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/icon.php?categoryid={$subcat.categoryid}{/if}[/img]</TD>
<TD width="95%" align="left" valign="middle" nowrap><FONT class="ItemsList">{ $subcat.category|escape }</FONT>

{ $subcategories[cat_num].description|escape} </TD>
{else}
<TD align="left" nowrap width="40%">[img]{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/icon.php?categoryid={$subcat.categoryid}{/if}[/img]</TD>
<TD width="95%" align="left" valign="middle" nowrap><FONT class="ItemsList">{ $subcat.category|escape }</FONT>
</TD>
{/if}
{* END SAFETYNET DSEFU MOD *}
<TD width="40%" align="right" nowrap><FONT class="Text">
{if $config.Appearance.count_products eq "Y"}
{if $subcat.product_count}{ $subcat.product_count }
{$lng.lbl_products} {elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower} {/if}
{/if}</FONT></TD>
</TR>
{/foreach}
</TABLE>


{/if}
{if $tmp and $products ne "" }
<BR clear="left">
<HR size="1" 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}


{ include file="customer/main/navigation.tpl" }
{/if}


{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
  #114  
Old 02-15-2006, 08:47 PM
 
alru111 alru111 is offline
 

eXpert
  
Join Date: Dec 2005
Posts: 244
 

Default

I have too many subcategories to be displayed on one page.
How can subcategories be broken down into several pages with
"ABCDEFGH..." or "Page1 Page2 Page 3..." on top
__________________
X-Cart version 4.0.19
Reply With Quote
  #115  
Old 02-22-2006, 09:40 PM
 
vikeny vikeny is offline
 

Member
  
Join Date: Jun 2004
Location: Los Angeles, CA.
Posts: 22
 

Default

A great Thank You to all those that have contributed to this great mod.

Unless I'm mistaken, It looks like the sub-cat icon is being sourced from the db instead of the file system.

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

Will it be possible to change this so that the icon image is sourced from the file system?
__________________
--
1: X-Cart 4.0.x(live), Apache/2.0.52 (Red Hat), PHP 4.3.9, MySQL 4.1.20
2,3,4,5: X-Cart 4.0.x(live), Apache/2.0.54 (Linux), PHP 4.4.0, MySQL 4.0.25
Reply With Quote
  #116  
Old 03-03-2006, 07:29 AM
 
alru111 alru111 is offline
 

eXpert
  
Join Date: Dec 2005
Posts: 244
 

Default

change image location in admin area from db to file system
__________________
X-Cart version 4.0.19
Reply With Quote
  #117  
Old 03-05-2006, 06:49 PM
 
Touchy Touchy is offline
 

Advanced Member
  
Join Date: Feb 2005
Location: USA
Posts: 49
 

Default Limiting the number sub categories displayed per page

Hi folks,

I see several people have asked but nobody has answered.

This mod is great but if you have a lot of sub categories, you end up with a huge list, that can take a long time to load.

Is it possible to paginate the display to say 10 sub categories per page.

We have large sub cat descriptions so adding more columns is not an option for us.

I think if this could be made possible this mod would be work for a lot more people.

Anybody Help or confirmation if it can be done would help everyone.
__________________
Thanks,

Version 4.0.17
Reply With Quote
  #118  
Old 03-14-2006, 08:41 AM
 
alru111 alru111 is offline
 

eXpert
  
Join Date: Dec 2005
Posts: 244
 

Default

I received a quote from x-cart to make subcategory pagination with a switch in general options.
Email me if you want to split the cost.
forum@cellcorner.com
__________________
X-Cart version 4.0.19
Reply With Quote
  #119  
Old 03-16-2006, 08:17 AM
 
gargonzo gargonzo is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 171
 

Default

ok here is what i figured out with this "MOD"

Open the CAT you want to work on.. fill in the following fields.. this is so you know which field is which snippet of code below.

category: what you have + TITLE ( this will be the page title )
Description: what you have + DESCRIPTION
push OK/Save

now:

edit subcatagories.tpl
File location: /customer/main/subcategories.tpl

Add the following in your *.TPL

{$current_category.description|escape}

above is same as following:

{$current_category.description|regex_replace:"/[\n]/":""}

to pull in extra keywords or subcat descriptions:

{$subcat.description|escape}

the subcat pulls in descrips from ther subcats as well..

Now paste all that fun stuff into your TPL (subcats) and submit it -- then preview.. you should see everything working.

NOW-- for me to get to this stage.. i had to change the SQL statement as posted further back in this MOD ( page 6 i think ).

Everything is working GREAT.. except on one of my pages i'm getting the above duplicated...will figure it out.. unless someone has a solution.

good luck.

ciao
garz
4.07/php.linux
__________________
xcart ver 4.xx/linux/php
Reply With Quote
  #120  
Old 06-09-2006, 05:19 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

One of my all time favorite mods, but if you have your images in the filesystem (which is recommended for speed reasons) this mod will continue to pull the images from the db, as it is hard-coded in. To fix this, replace this:

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

with this

Code:
{if $subcategories[cat_num].icon_url}[img]{$subcategories[cat_num].icon_url}[/img]{else}[img]{$xcart_web_dir}/default_icon.gif[/img]{/if}

You'll want to add in a height or width as well, as this will pull the full-sized image without it. You should notice a huge speed improvement on your category pages, particularly if you have a ton of sub-categories. The {if} statement simply shows the default_icon.gif image if there is no sub-category icon present. Enjoy!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:00 AM.

   

 
X-Cart forums © 2001-2020