| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Mod for subcategories in columns with descriptions and icons | ||||
|
|
Thread Tools | Search this Thread |
#271
|
|||||||||
|
|||||||||
Re: Mod for subcategories in columns with descriptions and icons
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}&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}&cat={$cat}&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}&cat={$cat}&page={$navigation_p age}{if $featured eq 'Y'}&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} {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"> </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" } |
|||||||||
|
#272
|
|||||||||
|
|||||||||
Re: Mod for subcategories in columns with descriptions and icons
Thanks a million! It looks like that is EXACTLY what I was looking for. I appreciate it!
Todd
__________________
B&T sales xCart 5 Business Core Version: 5.3.5 |
|||||||||
#273
|
|||||||
|
|||||||
Re: Mod for subcategories in columns with descriptions and icons
Hello I have 4.1.11 which post will show me how to do this mod, post number please
__________________
Runing on Linux server X-cart 4.1.8 GOLD |
|||||||
#275
|
|||||||
|
|||||||
Re: Mod for subcategories in columns with descriptions and icons
Great mod. Anyway to remove the product list from the main page though?
Shows all my categories on my welcome page but also is including product images with price. Any way to get rid of this?
__________________
X-Cart DB Version: 5 |
|||||||
#276
|
|||||||||
|
|||||||||
Re: Mod for subcategories in columns with descriptions and icons
Hi Guys I tried the code in post #271 which had some interesting effects
- displays the category thumbnail and a header link - unfortunately it doesn't show the category description text - it seems to have swapped sides with the lefthand navigation which has jumped to the righthand side of the page... looks like I need to make some changes any ideas? Nick |
|||||||||
#277
|
|||||||
|
|||||||
Re: Mod for subcategories in columns with descriptions and icons
Hi, I tried using this mod. I liked the way you were pulling in information. I changed it a bit to make a <ul> instead, but there is something wrong. It's not pulling any data from the database. The loop works fine, all the HTML gets populated, but wherever the data should appear, the HTML is blank. Is there a reason why this wouldn't pull in data for me? Maybe the version?
Below is the code, thanks very much to anyone who considers this small issue. Code:
__________________
Version 4.1.10 |
|||||||
#278
|
|||||||||
|
|||||||||
Re: Mod for subcategories in columns with descriptions and icons
this is a great mod. Looking for a modified version, which would read as follows:
CategoryA (Image) CategoryA (title) SubcategoryA (title) SubcategoryB (title) SubcategoryC (title) Does anyone know how to modify the code to do that???
__________________
4.4 Code:
|
|||||||||
#279
|
|||||||
|
|||||||
Re: Mod for subcategories in columns with descriptions and icons
I am using the code from post #271 to display my subcategories using version 4.1.10, although I changed the code to only display one category image and title per row. I have read and re-read this post over and over and I cannot find code that will work in v4.1.10 that allows for the inclusion of the category description within the row. When complete, I would like to display the category image on the left, then the category title to the right of the image and the category description below the category description. Would someone please help me understand how to add the additional code to the template(s) in v4.1.10?
Thank you so much in advance,
__________________
Tim x-cart pro 4.1.11, x-AOM, CDSEO, css layout - no tables (almost), free social bookmarking mod (xcartmod.co.uk - thanks), altered cart On Sale, One Page Checkout and Smart Search (all amazing products), Custom Code from CFL (the best), Hands-On Hosting for live site |
|||||||
#280
|
|||||||
|
|||||||
Re: Mod for subcategories in columns with descriptions and icons
I moved the code for the css to the skin1_c.css and this worked.
__________________
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 |
|||||||
|
|||
X-Cart forums © 2001-2020
|