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
  #11  
Old 10-15-2003, 09:44 AM
 
Nordic Nordic is offline
 

Member
  
Join Date: Jul 2003
Posts: 14
 

Default 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
Reply With Quote
  #12  
Old 10-26-2003, 09:09 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

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...
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #13  
Old 11-12-2003, 01:17 AM
 
wild boar wild boar is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 88
 

Default

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
__________________
hi
Reply With Quote
  #14  
Old 11-12-2003, 05:42 AM
 
MOC MOC is offline
 

Senior Member
  
Join Date: Oct 2002
Posts: 171
 

Default

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


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'
Reply With Quote
  #15  
Old 11-15-2003, 03:16 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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.
Reply With Quote
  #16  
Old 11-23-2003, 10:56 AM
 
reaction reaction is offline
 

Newbie
  
Join Date: Jun 2003
Posts: 4
 

Default 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
Reply With Quote
  #17  
Old 11-23-2003, 11:00 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

#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.
Reply With Quote
  #18  
Old 11-23-2003, 02:39 PM
 
reaction reaction is offline
 

Newbie
  
Join Date: Jun 2003
Posts: 4
 

Default 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}
Reply With Quote
  #19  
Old 11-23-2003, 02:52 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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.
Reply With Quote
  #20  
Old 11-23-2003, 03:58 PM
 
reaction reaction is offline
 

Newbie
  
Join Date: Jun 2003
Posts: 4
 

Default 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" }
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 01:48 AM.

   

 
X-Cart forums © 2001-2020