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)

GiZ 01-22-2009 05:07 AM

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.

gotpump 01-25-2009 04:34 PM

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?

masada3336 01-27-2009 08:32 PM

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


rjcbear 01-30-2009 09:24 AM

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

balinor 01-30-2009 09:25 AM

Re: Mod for subcategories in columns with descriptions and icons
 
The code is in the thread, just read through the last couple pages :)

rjcbear 01-30-2009 09:30 AM

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

tam10 02-03-2009 10:06 AM

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

Glowinafuse 03-28-2009 09:18 AM

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


cosy 03-31-2009 06:09 PM

Re: Mod for subcategories in columns with descriptions and icons
 
HI,

How do i make the box around all the images?

crazyoval 04-02-2009 10:11 AM

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


All times are GMT -8. The time now is 12:29 PM.

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