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)

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 04:56 AM.

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