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)
-   -   Mod for subcategories in columns with descriptions and icons (https://forum.x-cart.com/showthread.php?t=3848)

finestshops 08-02-2003 04:49 PM

Mod for subcategories in columns with descriptions and icons
 
Here is new subcategories.tpl to display subcategories in columns
with descriptions and icons. Example here:
http://www.bitsnspu.finestshops.com/store/customer/home.php?cat=2

Enjoy :wink:

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>

        { $categories[cat_num].description|escape }
        </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}

{/capture}
{include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"}




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

{if $products eq ""}
{if $f_products ne ""}


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


jeeya 08-02-2003 04:57 PM

.
 
that look good, do you know code if I want to movie subcatagories under the featured products instead of top on it,

finestshops 08-02-2003 05:19 PM

Re: .
 
Quote:

Originally Posted by raxitpatel
if I want to movie subcatagories under the featured products instead of top on it


Just move this code from the end
Code:

{if $products eq ""}
{if $f_products ne ""}


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


before this one

Code:

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

{section name=cat_num loop=$subcategories}
...


lizlarry 08-16-2003 09:01 AM

Thank you !! I modified this a tiny bit and I have exactly what I need. Woo hoo!!!
:D
Liz

toby5482 09-15-2003 12:28 PM

How do you get the subcatergory text to be underneath the icon, rather than to the right hand side?

PhilJ 09-15-2003 01:41 PM

this is for v3.4.5

Code:

{* $Id: subcategories.tpl,v 1.32 2003/04/24 09:50:33 svowl 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}





{* ==================== Sub categories mod start *}

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



<font size="3">{ $subcategories[cat_num].category|escape }</font>
{if $config.Appearance.count_products eq "Y"}
        {if $subcategories[cat_num].product_count}

        ({ $subcategories[cat_num].product_count } Products)
        {elseif $subcategories[cat_num].subcategory_count}
({ $subcategories[cat_num].subcategory_count } Subcategories)</a>
        {/if}
{/if}

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

{* ==================== Sub categories mod end *}






{if $tmp and $products ne "" }
<br clear=_all><hr size=1 noshade>
{/if}
{include file="customer/main/products.tpl" products=$products}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category_name|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" }




specify the number of columns where it says 'div by 3'

dealsondeals 09-15-2003 07:45 PM

:wink: Very Nice! Good job! Definitely one to put in the archive for later use.

Regards,

Glen

toby5482 09-16-2003 04:13 AM

Thanks for that PhilJ, works a treat.

longseason 10-06-2003 10:30 PM

Display works fine but new warning appears
 
I copied over the mod to subcatagories.tpl and the layout works great except now I get a warning-

Warning: Unknown modifier '/' in /x-cart/Smarty-2.5.0/plugins/modifier.regex_replace.php on line 13

Any ideas on how to get rid of it? If I restore the file to default the message goes away. I tried to check the file but don't know enough about php to figure it out. I'm using x-cart 3.4.8, php 4.2.3.

Any help would be great.
thanks.[/b]

rickallen1 10-08-2003 11:04 AM

Same problem here
 
Warning: Unknown modifier '/' in /home/virtual/site42/fst/var/www/html/store/Smarty-2.5.0/plugins/modifier.regex_replace.php on line 13

Note that magic_quotes_gpc is disabled on my server. Do I need to add a couple of escapes someplace?

This is exactly the kind of mod I was looking for. Looks great on the demo site.

Thanks.

Nordic 10-15-2003 09:44 AM

Mod to PhilJ's mod
 
Hi,

moded slightly to get it more as 27Stars to work with 3.4.8 and it works fine :)

{* ==================== Sub categories mod start *}

{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 3}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]</a>
</td>
<td align="left" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<font size="3">{ $subcategories[cat_num].category|escape }</font></a>

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

({ $subcategories[cat_num].product_count } Products)
{elseif $subcategories[cat_num].subcategory_count}
({ $subcategories[cat_num].subcategory_count } Subcategories)
{/if}
{/if}
</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}

{* ==================== Sub categories mod end *}


-Nordic

BoomBoomBap 10-26-2003 09:09 PM

Okay that's a very sweet mod!

Is there a way to have a text listing of the subcategories on the category listing page?

ie.
Clicking on the main category will show a listing of the subcategories and the sub-subcategories.

I've been trying to figure this out with no luck.

Hope this makes sense...

wild boar 11-12-2003 01:17 AM

Hey guys, how would I do this same mod in 3.4.7? I'm not familiar with what changes in each version...

thanks,
chris

MOC 11-12-2003 05:42 AM

Hi Wild,

just copy the post of PhilJ (below) into your /customer/main/subcategories.tpl it will works with 3.4.7.

GREAT MOD

Saskia :D


Quote:

Originally Posted by PhilJ
this is for v3.4.5

Code:

{* $Id: subcategories.tpl,v 1.32 2003/04/24 09:50:33 svowl 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}





{* ==================== Sub categories mod start *}

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



<font size="3">{ $subcategories[cat_num].category|escape }</font>
{if $config.Appearance.count_products eq "Y"}
        {if $subcategories[cat_num].product_count}

        ({ $subcategories[cat_num].product_count } Products)
        {elseif $subcategories[cat_num].subcategory_count}
({ $subcategories[cat_num].subcategory_count } Subcategories)</a>
        {/if}
{/if}

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

{* ==================== Sub categories mod end *}






{if $tmp and $products ne "" }
<br clear=_all><hr size=1 noshade>
{/if}
{include file="customer/main/products.tpl" products=$products}
{if $products eq "" and $tmp eq "0"}
{$lng.txt_no_products_in_cat}
{/if}
{/capture}
{include file="dialog.tpl" title=$current_category.category_name|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" }




specify the number of columns where it says 'div by 3'


adpboss 11-15-2003 03:16 PM

My code for 3.4.9. Displays 2 columns, cat name under the image, extra space between horizontal rows

Code:

{* ==================== Sub categories mod start *}

{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 2}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]</a>

 
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<font size="3">{ $subcategories[cat_num].category|escape }</font></a>




{ $subcategories[cat_num].description|escape }
{if $config.Appearance.count_products eq "Y"}
{if $subcategories[cat_num].product_count}
 
({ $subcategories[cat_num].product_count } Products)
{elseif $subcategories[cat_num].subcategory_count}
({ $subcategories[cat_num].subcategory_count } Subcategories)
{/if}
{/if}
</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}

{* ==================== Sub categories mod end *}


Thanks to 27stars for getting us started.

reaction 11-23-2003 10:56 AM

Small Problem Combining mods
 
Real newbe, Thanks for a great mod, have combined main mod with 3.4.9 to run on new site migrating from Miva.

Running 3.4.8 & PHP 4.3.4RC1 but 3.4.8 mod did not work well.

2 problems, 1-still displaying "There are no available products..."

http://www2.photobadge.com/customer/home.php?cat=41

2-The border around products is cut off at top??

http://www2.photobadge.com/customer/home.php?cat=46

Would welcome any help

adpboss 11-23-2003 11:00 AM

#1 Post your categories.tpl code here (use the CODE tags please, makes it easier to read).

# Your dialog capture is getting cut off prematurely. Post your products.tpl code here (use the CODE tags please, makes it easier to read).

We can get this figured out easily I am sure.

reaction 11-23-2003 02:39 PM

Display Issues
 
Hi adpboss, thanks for your help.

Here is the categories.tpl

Code:


{* $Id: categories.tpl,v 1.18 2003/02/25 08:58:46 olga Exp $ *}
{capture name=menu}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
<font class=CategoriesList>{ $categories[cat_num].category_name|escape }</font>

{/section}
{else} {section name=cat_num loop=$subcategories}
<font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font>

{/section}
{/if}


{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


Here is the products.tpl

Code:


{* $Id: products.tpl,v 1.33.2.2 2003/08/26 06:06:22 svowl Exp $ *}
{if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")}
{include file="customer/main/products_t.tpl" products=$products}
{else}
{if $products}
{section name=product loop=$products}
<table border=0 width=100%>
<tr><td width=90 align=center valign=top>
<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}
{$lng.lbl_see_details}</a>
</td>
<td valign=top>
{$products[product].product}</font>
<font size=1>




{$products[product].descr|truncate:300:"...":true}


</font>
<hr size=1 noshade width=230 align=left>
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].price ne 0}
{if $products[product].list_price gt 0 and $products[product].price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].price lprice=$products[product].list_price format="%d" assign=discount}
<font class=MarketPrice>{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font>

{/if}
<font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].list_price gt 0 and $products[product].price lt $products[product].list_price}, save {$discount}%{/if}{if $config.Taxes.use_vat eq "Y" and $products[product].vat gt "0"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if}
{else}
<font class=ProductPrice>{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
</td></tr>
</table>






{/section}
{else}
{$lng.lbl_no_products_found}
{/if}
{/if}


adpboss 11-23-2003 02:52 PM

My bad. I must havenot been paying close attention.

We need your customer/main/subcategoies.tpl file posted.

I think both of the problems are there. Again, my apologies. :?

reaction 11-23-2003 03:58 PM

Display Prob
 
Hello adpboss,

Thank you,

Here it is.

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"}

{* ==================== Sub categories mod start *}

{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 2}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]../icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]</a>


<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<font size="2">{ $subcategories[cat_num].category|escape }</font></a>

{ $subcategories[cat_num].description|escape }
{if $config.Appearance.count_products eq "Y"}
{if $subcategories[cat_num].product_count}
 
({ $subcategories[cat_num].product_count } Products)
{elseif $subcategories[cat_num].subcategory_count}
({ $subcategories[cat_num].subcategory_count } Subcategories)
{/if}
{/if}
</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}

{* ==================== Sub categories mod end *}


 
{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}

{/capture}
{include file="dialog.tpl" title=$current_category.category|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"}



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

{if $products eq ""}
{if $f_products ne ""}


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


adpboss 11-23-2003 04:09 PM

Ok for starters in subcategories.tpl

replace

Code:

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


with

Code:

{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}


Right above the start of the Mod. This will lose the extra text saying that there are no products.

I'm working on the other issue.

reaction 11-24-2003 08:09 PM

Category Display Issues
 
Hello adpboss,

Thank you for your mod, worked great.

mcmann 10-12-2004 12:40 PM

First thanks for this MOD, it was just what I was looking for :)

I'm hoping someone can help me here

I'm using this MOD successfully on our site, with one problem.

If I use any html code in my description all the codes show in the description created next to the image.
http://www.wahmboutique.com/boutique/customer/home.php?cat=303
The code is applied correctly above the subcategory name when you open the subcategory.
http://www.wahmboutique.com/boutique/customer/home.php?cat=302

Is there a way to fix this and if so, can someone lead me in the right direction.

Thanks in advance,
May
__________________
Version 3.5.9

nhraracer241 10-14-2004 09:33 PM

May,
Can you post your subcategories.tpl and your subcat description for Lil Mermaids?

Bobby

mcmann 10-16-2004 09:32 AM

I'll get the code in a bit, but for the description - the only html used in the description right now is a
.

May

adamsteinhoff 10-17-2004 12:03 PM

I was hoping that someone would help me in troubleshooting this script. I implemented the script and see the extra columns with icons, but I don't get the descriptions or product counts.

Here is a link to one of my categories: http://www.eartpark.com/home.php?cat=253

Here is a link to one of the sub-categories: http://www.eartpark.com/home.php?cat=263

As you can see, there is a text description in the sub-category. Why would it not display?

Here is the code that I am using in subcategories.tpl:

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=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}
{* ==================== Sub categories mod end *}
{if $tmp and $products ne "" }
<br clear=_all>{*<hr size=1 noshade>*}
{/if}

{if $products ne "" and $tmp eq "0"}



{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|regex_replace:"/.*\//":"" content=$smarty.capture.dialog extra="width=100%"}

{if $products eq "" and $f_products ne ""}





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


adpboss 10-17-2004 12:05 PM

Add this to get the description

Code:


{$products[product].descr|truncate:300:"...":true}



adamsteinhoff 10-17-2004 01:51 PM

Quote:

Originally Posted by adpboss
Add this to get the description

Code:


{$products[product].descr|truncate:300:"...":true}




Thanks for the quick reply, but shouldn't the description for the subcategories come from something that looks like this? The code you sent looks like what I would use for product descriptions...

Code:

{$subcategories[cat_num].category|escape}

adpboss 10-17-2004 01:53 PM

You are correct. I have made a bo-bo.
:?

#-o

lildawg 10-17-2004 01:56 PM

WHAT??? :? You of all people have made a boo bo? [-X I never thought I would see the day. :lol:

adpboss 10-17-2004 01:59 PM

Second time today.

I'm really depressed about it. Time for a drink!

lildawg 10-17-2004 02:01 PM

2 in one day. #-o Sure you didnt start drinking earlier? :lol:

adpboss 10-17-2004 02:04 PM

#-o

nhraracer241 10-24-2004 09:48 PM

May,
I think the fix for your problem is in this bit of code from subcategories.tpl

Quote:

<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"}



Delete |escape from $subcategories[cat_num].description so you have this:
Quote:

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

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



and that should fix it.

Bobby

mcmann 10-26-2004 08:40 AM

THANK YOU!! That did the trick :-)

dalmuti 10-26-2004 09:59 AM

I would love to implement this mod but I am really new to x-cart and have version 4.0.5....and wonder if anyone has implemented on this version?

I read through the entire post and am afraid I would screw it up. Wonder if anyone can post exact steps to implement?

It would be appreciated greatly.

Thanks,

Dalmuti

adamsteinhoff 10-31-2004 10:53 AM

Quote:

Originally Posted by nhraracer241
May,
I think the fix for your problem is in this bit of code from subcategories.tpl

Quote:

<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"}



Delete |escape from $subcategories[cat_num].description so you have this:
Quote:

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

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



and that should fix it.

Bobby


Bobby,

Thanks for the code, but it still doesn't work on my site. Any other suggestions?

Adam

grimscot 11-09-2004 05:55 PM

Quote:

Originally Posted by dalmuti
I would love to implement this mod but I am really new to x-cart and have version 4.0.5....and wonder if anyone has implemented on this version?



I have implemented this on 4.0.6 and it works with one small modification.

All you have to do is edit the skin1/customer/main/subcategories.tpl file

and replace the code with this

Code:

{* $Id: subcategories.tpl,v 1.43.2.2 2004/10/07 07:08:51 max Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}



{include file="modules/Bestsellers/bestsellers.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}


{* ==================== Sub categories mod start *}

{section name=cat_num loop=$subcategories}
{ if %cat_num.first% }
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
{/if}
{ if %cat_num.index% is div by 2}
<tr>
{/if}
<td align="center" valign="top">
<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
[img]{$xcart_web_dir}/icon.php?categoryid={$subcategories[cat_num].categoryid}[/img]</a>


<a href="home.php?cat={ $subcategories[cat_num].categoryid }">
<font size="3">{ $subcategories[cat_num].category|escape }</font></a>




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

({ $subcategories[cat_num].product_count } Products)
{elseif $subcategories[cat_num].subcategory_count}
({ $subcategories[cat_num].subcategory_count } Subcategories)
{/if}
{/if}
</td>
{ if %cat_num.last% }
</tr>
</table>
{/if}
{/section}

{* ==================== Sub categories mod end *}


{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}
<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_man}
{/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" }


dalmuti 11-10-2004 05:37 AM

That works perfect in 4.05 as well.

Thanks so much for the code.

Dalmuti :wink:

EnriqueHavoc 11-11-2004 08:57 AM

awesome! http://www.motionzoo.com/forum/images/smilies/more/kiss.gif


All times are GMT -8. The time now is 10:56 AM.

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