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)

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



All times are GMT -8. The time now is 01:20 PM.

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