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
  #281  
Old 01-22-2009, 05:07 AM
 
GiZ GiZ is offline
 

Member
  
Join Date: Oct 2007
Posts: 11
 

Default Re: Mod for subcategories in columns with descriptions and icons

I moved the code from for the skin1.css to skin1_c.css and it worked for me.
__________________
X-Cart version - 4.1.8
PHP - 5.24
MySQL server version 5.0.45
Web server - Apache/2.2.6 (FreeBSD) mod_ssl/2.2.6 OpenSSL/0.9.7e-p1 PHP/5.2.4 with Suhosin-Patch
O.S. - FreeBSD 6.2-RELEASE
Reply With Quote
  #282  
Old 01-25-2009, 04:34 PM
 
gotpump gotpump is offline
 

eXpert
  
Join Date: Aug 2008
Posts: 272
 

Default Re: Mod for subcategories in columns with descriptions and icons

Is there anyway to change my category list in vertmenu left to display icons and text instead of just text?
__________________
X-Cart DB Version: 5
Reply With Quote
  #283  
Old 01-27-2009, 08:32 PM
 
masada3336 masada3336 is offline
 

Senior Member
  
Join Date: Jan 2009
Posts: 115
 

Default Re: Mod for subcategories in columns with descriptions and icons

Thanks so much for this - but I have a really weird thing going on - on the two main categories that don't have sub-categories, only products, it's showing up differently. Is there anyway to adapt this so the categories without sub-categories show the same way?
Thanks!



Quote:
Originally Posted by 27stars
Hi toddpatterson,

Please try to replace customer/main/subcategories.tpl with this file:

{* $Id: subcategories.tpl,v 1.55.2.1 2006/06/27 08:20:37 svowl Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}

{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}

{if $active_modules.Special_Offers && $category_offers}
<br /><br />
{include file="modules/Special_Offers/customer/category_offers_short_list.tpl"}
{/if}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<br /><br />{/if}
{capture name=dialog}
{assign var="tmp" value="0"}
{foreach from=$subcategories item=c key=catid}
{if $c.category}{assign var="tmp" value="1"}{/if}
{/foreach}


{if $subcategories}

{*
<table cellspacing="5" width="100%">
{foreach from=$subcategories item=subcat}
<tr>
{if $tmp and $first_subcat ne "Y"}
<td valign="top" rowspan="{count value=$subcategories print="Y"}"><img src="{if $current_category.icon_url}{$current_category.icon _url}{else}{$xcart_web_dir}/image.php?id={$cat}&amp;type=C{/if}" alt="" /></td>
{assign var="first_subcat" value="Y"}
{/if}
<td class="SubcatTitle"><a href="home.php?cat={ $subcat.categoryid }"><font class="ItemsList">{ $subcat.category|escape }</font></a><br /></td>
<td class="SubcatInfo">{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}</td>
</tr>
{/foreach}
</table>
*}

{* subcategories in 4 columns mod by Finestshops.com *}
<table border=0 cellspacing="0" cellspacing="0" width="100%">
{foreach from=$subcategories key=k item=subcat name=subcategories}
{if $smarty.foreach.subcategories.index is div by 4}
</tr><tr valign="top">
{/if}
<td valign="top" width="25%" align="center">

<A href="home.php?cat={ $subcat.categoryid }"><IMG alt="{* $subcat.category|escape *}" border="0" src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/icon.php?categoryid={$subcat.categoryid}{/if}"></a>
<br>
<A href="home.php?cat={ $subcat.categoryid }"><FONT class="ItemsList">{ $subcat.category|escape }</FONT></A>
<br>
<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>
{/foreach}
</tr>
</table>
{* subcategories in 4 columns mod by Finestshops.com *}

<table width="100%" cellpadding="5" cellspacing="1">

{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}

{section name=product loop=$products}
{assign var="discount" value=0}

{if %product.index% is div by $config.Appearance.products_per_row}
<tr>
{assign var="cell_counter" value=0}
{/if}

{math equation="x+1" x=$cell_counter assign="cell_counter" }

<td width="{$width}%" class="PListCell">

<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_p age}" class="ProductTitle">{$products[product].product}</a><br />
{if $config.Appearance.display_productcode_in_list eq "Y" and $products[product].productcode ne ""}
{$lng.lbl_sku}: {$products[product].productcode}<br />
{/if}
<table cellpadding="3" cellspacing="0" width="100%">
<tr>
<td height="100" nowrap="nowrap" align="center">{include file="product_thumbnail_cust.tpl" product=$products[product]}</td>
</tr>
</table>
<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_p age}{if $featured eq 'Y'}&amp;featured{/if}">{$lng.lbl_see_details}</a>
{if $products[product].product_type ne "C"}
<br />
<br />
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $config.General.unlimited_products ne "Y" && ($products[product].avail le 0 or $products[product].avail lt $products[product].min_amount) && $products[product].variantid}
&nbsp;
{elseif $products[product].taxed_price ne 0}
{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0}
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{/if}
{/if}
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</font><br /><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</font>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""},{/if} {$lng.lbl_save_price} {$discount}%{/if}
{if $products[product].taxes}<br />{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
{include file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]}
{/if}
{else}
<font class="ProductPrice">{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0}
<div align="center" style="width: 100%; padding-top: 10px;">
{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}
</div>
{/if}
{*** Uncomment it if you need 'Buy Now' button ***
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
*** Uncomment it if you need 'Buy Now' button ***}
{/if}
</td>

{capture name=prod_index}
{math equation="index+x+1" index=%product.index% x=$config.Appearance.products_per_row}
{/capture}
{if $smarty.capture.prod_index is div by $config.Appearance.products_per_row }
</tr>
{/if}

{/section}

{if $cell_counter lt $config.Appearance.products_per_row}
{section name=rest_cells loop=$config.Appearance.products_per_row start=$cell_counter}
<td class="SectionBox">&nbsp;</td>
{/section}
</tr>
{/if}

</table>

{/if}


{if $tmp and $products ne "" }
<br clear="left" />
<hr size="1" noshade="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}
<br />
{ include file="customer/main/navigation.tpl" }
{/if}
<br />
{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 ""}
<p />
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }
__________________
4.4.5 - with Customized Smart Template
Reply With Quote
  #284  
Old 01-30-2009, 09:24 AM
  rjcbear's Avatar 
rjcbear rjcbear is offline
 

X-Adept
  
Join Date: Jun 2004
Location: Alabama,U.S.A
Posts: 503
 

Default Re: Mod for subcategories in columns with descriptions and icons

Hey guys,

Does any one has this mod working with 4.1.11 and like to share the code. I will be very grateful.

Kind regards,

Ricky
__________________
X-CART Gold version 4.0.14 & 4.1.11
Apache Version 1.3.29 (Unix)
EWDHosting-Quality X-cart Hosting
We will always sell you the right shoe and the left one is free.
Reply With Quote
  #285  
Old 01-30-2009, 09:25 AM
 
balinor balinor is offline
 

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

Default Re: Mod for subcategories in columns with descriptions and icons

The code is in the thread, just read through the last couple pages
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #286  
Old 01-30-2009, 09:30 AM
  rjcbear's Avatar 
rjcbear rjcbear is offline
 

X-Adept
  
Join Date: Jun 2004
Location: Alabama,U.S.A
Posts: 503
 

Default Re: Mod for subcategories in columns with descriptions and icons

Balinor,

After I post the replied i found a code and I am comparing it now to see if is the correct version.

Thank you

Kind regards,

Ricky
__________________
X-CART Gold version 4.0.14 & 4.1.11
Apache Version 1.3.29 (Unix)
EWDHosting-Quality X-cart Hosting
We will always sell you the right shoe and the left one is free.
Reply With Quote
  #287  
Old 02-03-2009, 10:06 AM
  tam10's Avatar 
tam10 tam10 is offline
 

eXpert
  
Join Date: Mar 2007
Posts: 252
 

Default Re: Mod for subcategories in columns with descriptions and icons

hi,

It works great!!! Thanks.

I had some modification on home page, where i choose product for featured items, without price, and the customer choose if to see the item details or can go to the category products to see them all.

http://www.4-legged.com/images/T/TwinkleToes-t.jpg See details
http://www.4-legged.com/skin1/images/spacer.gif
See all category products



I would like to change it now, so this new mod will work on the home page too.

No clue how to do it.

I found that a customer/main/products_tfp.tpl was added.
If i delete this tpl ( _tfp) from /customer/main/featured.tpl - now the prices are shown and no access to the category. But i do not get the new mod to work.
http://www.4-legged.com/images/T/TwinkleToes-t.jpg
See details

Our price from:

/customer/main/featured.tpl


{capture name=dialog}
{if $f_products ne ""}
{if $total_pages gt 2}
<br />
{ include file="customer/main/navigation.tpl" }
{/if}
{include file="customer/main/products_tfp.tpl" products=$f_products featured="Y"}
{if $total_pages gt 2}
<br />
{ include file="customer/main/navigation.tpl" }
{/if}
{else}
{$lng.txt_no_featured}
{/if}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_featured_products content=$smarty.capture.dialog extra='width="100%"'}

Any help greatly appreciated

Tammy
__________________
Tammy
x-cart gold + 4.7.2
x-cart 5.2.10

Reply With Quote
  #288  
Old 03-28-2009, 09:18 AM
 
Glowinafuse Glowinafuse is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 80
 

Default Re: Mod for subcategories in columns with descriptions and icons

I am gonna be adding the below code. What would need to be changed or added to see the number of items in each category?

Thanks in advance

Quote:
Originally Posted by 27stars
Hi toddpatterson,

Please try to replace customer/main/subcategories.tpl with this file:

{* $Id: subcategories.tpl,v 1.55.2.1 2006/06/27 08:20:37 svowl Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu ne "Y"}

{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}

{if $active_modules.Special_Offers && $category_offers}
<br /><br />
{include file="modules/Special_Offers/customer/category_offers_short_list.tpl"}
{/if}
{if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description}<br /><br />{/if}
{capture name=dialog}
{assign var="tmp" value="0"}
{foreach from=$subcategories item=c key=catid}
{if $c.category}{assign var="tmp" value="1"}{/if}
{/foreach}


{if $subcategories}

{*
<table cellspacing="5" width="100%">
{foreach from=$subcategories item=subcat}
<tr>
{if $tmp and $first_subcat ne "Y"}
<td valign="top" rowspan="{count value=$subcategories print="Y"}"><img src="{if $current_category.icon_url}{$current_category.icon _url}{else}{$xcart_web_dir}/image.php?id={$cat}&amp;type=C{/if}" alt="" /></td>
{assign var="first_subcat" value="Y"}
{/if}
<td class="SubcatTitle"><a href="home.php?cat={ $subcat.categoryid }"><font class="ItemsList">{ $subcat.category|escape }</font></a><br /></td>
<td class="SubcatInfo">{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}</td>
</tr>
{/foreach}
</table>
*}

{* subcategories in 4 columns mod by Finestshops.com *}
<table border=0 cellspacing="0" cellspacing="0" width="100%">
{foreach from=$subcategories key=k item=subcat name=subcategories}
{if $smarty.foreach.subcategories.index is div by 4}
</tr><tr valign="top">
{/if}
<td valign="top" width="25%" align="center">

<A href="home.php?cat={ $subcat.categoryid }"><IMG alt="{* $subcat.category|escape *}" border="0" src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/icon.php?categoryid={$subcat.categoryid}{/if}"></a>
<br>
<A href="home.php?cat={ $subcat.categoryid }"><FONT class="ItemsList">{ $subcat.category|escape }</FONT></A>
<br>
<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>
{/foreach}
</tr>
</table>
{* subcategories in 4 columns mod by Finestshops.com *}

<table width="100%" cellpadding="5" cellspacing="1">

{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}

{section name=product loop=$products}
{assign var="discount" value=0}

{if %product.index% is div by $config.Appearance.products_per_row}
<tr>
{assign var="cell_counter" value=0}
{/if}

{math equation="x+1" x=$cell_counter assign="cell_counter" }

<td width="{$width}%" class="PListCell">

<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_p age}" class="ProductTitle">{$products[product].product}</a><br />
{if $config.Appearance.display_productcode_in_list eq "Y" and $products[product].productcode ne ""}
{$lng.lbl_sku}: {$products[product].productcode}<br />
{/if}
<table cellpadding="3" cellspacing="0" width="100%">
<tr>
<td height="100" nowrap="nowrap" align="center">{include file="product_thumbnail_cust.tpl" product=$products[product]}</td>
</tr>
</table>
<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_p age}{if $featured eq 'Y'}&amp;featured{/if}">{$lng.lbl_see_details}</a>
{if $products[product].product_type ne "C"}
<br />
<br />
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $config.General.unlimited_products ne "Y" && ($products[product].avail le 0 or $products[product].avail lt $products[product].min_amount) && $products[product].variantid}
&nbsp;
{elseif $products[product].taxed_price ne 0}
{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0}
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{/if}
{/if}
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</font><br /><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</font>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""},{/if} {$lng.lbl_save_price} {$discount}%{/if}
{if $products[product].taxes}<br />{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
{include file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]}
{/if}
{else}
<font class="ProductPrice">{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0}
<div align="center" style="width: 100%; padding-top: 10px;">
{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}
</div>
{/if}
{*** Uncomment it if you need 'Buy Now' button ***
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
*** Uncomment it if you need 'Buy Now' button ***}
{/if}
</td>

{capture name=prod_index}
{math equation="index+x+1" index=%product.index% x=$config.Appearance.products_per_row}
{/capture}
{if $smarty.capture.prod_index is div by $config.Appearance.products_per_row }
</tr>
{/if}

{/section}

{if $cell_counter lt $config.Appearance.products_per_row}
{section name=rest_cells loop=$config.Appearance.products_per_row start=$cell_counter}
<td class="SectionBox">&nbsp;</td>
{/section}
</tr>
{/if}

</table>

{/if}


{if $tmp and $products ne "" }
<br clear="left" />
<hr size="1" noshade="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}
<br />
{ include file="customer/main/navigation.tpl" }
{/if}
<br />
{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 ""}
<p />
{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }
__________________
Gold 4.1.11
www.houseoftropicals.com/store
Reply With Quote
  #289  
Old 03-31-2009, 06:09 PM
 
cosy cosy is offline
 

Advanced Member
  
Join Date: Mar 2009
Posts: 79
 

Default Re: Mod for subcategories in columns with descriptions and icons

HI,

How do i make the box around all the images?
__________________
Version 4.2.0
Testing v 4.4
Reply With Quote
  #290  
Old 04-02-2009, 10:11 AM
  crazyoval's Avatar 
crazyoval crazyoval is offline
 

X-Adept
  
Join Date: Jun 2006
Location: UK
Posts: 559
 

Default Re: Mod for subcategories in columns with descriptions and icons

Has anyone got an example of this running on 4.1.10 or 4.1.11?

Thanks
__________________
X-Cart 4.1.11 on Linux
HandsOnWebHosting: Very helpful & professional
Custom Skin Design by ARS.
Numerous, ney, hundreds of modifications by ARS.
AlteredCart: Download Expander, One Page Checkout,
BCS Engineering: Great team, Top service.
WebsiteCM: good products & very professional
CDSEO, Hidden Categories, Custom Work
Magnetic One Store Manager: Brill
Forms To Go: Excellent+A+support
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 09:57 PM.

   

 
X-Cart forums © 2001-2020