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
  #231  
Old 11-08-2007, 01:54 AM
 
aerogear2000 aerogear2000 is offline
 

Senior Member
  
Join Date: Jul 2007
Posts: 143
 

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

thanks mod work great
__________________
Runing on Linux server
X-cart 4.1.8 GOLD
Reply With Quote
  #232  
Old 11-16-2007, 04:46 PM
 
northstar northstar is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 33
 

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

Mod is great! Works in 4.1.5, too! Thanks!
__________________
Alisa
X-Cart 4.3
Reply With Quote
  #233  
Old 12-02-2007, 07:53 AM
 
JJO JJO is offline
 

Newbie
  
Join Date: Nov 2007
Posts: 4
 

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

Thanks very much for this great mod, I am new to X-Cart and got it working in a couple of minutes!

Only thing that took some time was aligning text and thumbnails correctly.
I read that more people were encountering this problem, the solutution for me was very simple.

When you place the new code in skin1.css be sure to place an enter (blank line) above the /*

Kind regards,
JJ
__________________
Version 4.1.9
Reply With Quote
  #234  
Old 12-06-2007, 12:01 PM
 
cutterc cutterc is offline
 

Advanced Member
  
Join Date: Aug 2006
Posts: 93
 

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

This is an awsome mod...works perfect in 4.1.9 that is modified quite a bit....super job...
__________________
X-Cart Gold
Version 4.1.9
RMA 4.1.9
One Page Checkout v1.3.11
CDSEO
PHP 5.2.9
SQL 5.1.30

Reply With Quote
  #235  
Old 12-18-2007, 10:44 PM
 
aerogear2000 aerogear2000 is offline
 

Senior Member
  
Join Date: Jul 2007
Posts: 143
 

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

any one know how to fix this problem, here is a picture


http://www.eracingworks.com/stuff.JPG
__________________
Runing on Linux server
X-cart 4.1.8 GOLD
Reply With Quote
  #236  
Old 12-18-2007, 10:57 PM
 
aerogear2000 aerogear2000 is offline
 

Senior Member
  
Join Date: Jul 2007
Posts: 143
 

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

any pictures we enter in the sub catagories will appear also
__________________
Runing on Linux server
X-cart 4.1.8 GOLD
Reply With Quote
  #237  
Old 12-24-2007, 05:43 AM
 
rashriaz rashriaz is offline
 

Advanced Member
  
Join Date: Oct 2007
Posts: 72
 

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

did you find a solution to this as I am having the same issue.

thanks

Quote:
Originally Posted by alreadyregistered
I have the mod working for my version (see below). However, the thumbnail placement, according to the division, is not good.

I have:
15 subcategories (in one category)
code set for 3 columns, colspan=3

Displays as
4 images on first row
3 images on 2nd, 3rd, 4th rows
2 image on last row

Rather than 3 items on each row. Any ideas how to (scalably) force this?
__________________
rashriaz
product -x-cart gold 4.1.9
operating system -windows
location - uk
Reply With Quote
  #238  
Old 12-31-2007, 06:18 PM
 
MMB MMB is offline
 

Member
  
Join Date: Nov 2002
Location: Lincoln Park MI
Posts: 17
 

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

Quote:
Originally Posted by MoonDog
This is for v4.1.8

Thanks to mrkenzie from post #137 for the modifications and the original poster 27stars for the original creation, I got this working on v4.1.8 with just minor modifications.

These instructions are basically the same as post #137, but I'll explain it with the code modifications that I have.

Mod for subcategories in columns with descriptions and icons for v4.1.8
1. the default "No Image Available" image is displayed if none is assigned
2. product description is displayed below the icon.
3. quantity will display a number in parenthesis and without the word 'product' and "(0)" if there are no subcategories or products for a particular category.
4. and it will also show the subcategory DESCRIPTION if there is one when you hover over the subcategory link.
------------------------------------------------------------

Start by adding this code to the end of the xcart/skin1/skin1.css file.

Code:
/* For subcategories in columns with descriptions and icons */ .ColumnTitles { TEXT-ALIGN: center; WIDTH: 33% PADDING-LEFT: 5px; }

Find the following code in xcart/include/categories.php:

Code:
$_categories = func_query_hash("SELECT $to_search FROM $sql_tbl[categories] USE INDEX (am) $join_tbl ".(!empty($search_condition)?"WHERE ".implode(" AND ", $search_condition):"")." GROUP BY $sql_tbl[categories].categoryid ".$sort_condition, "categoryid", false);

and replace with this (in order to get the category description):

Code:
$_categories = func_query_hash("SELECT $to_search, $sql_tbl[categories].description FROM $sql_tbl[categories] USE INDEX (am) $join_tbl ".(!empty($search_condition)?"WHERE ".implode(" AND ", $search_condition):"")." GROUP BY $sql_tbl[categories].categoryid ".$sort_condition, "categoryid", false);

Next, find the following code, from <table ..to...</table> in skin1/customer/main/subcategories.tpl and delete it:

Code:
<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>

And replace that code with this:

Code:
<table cellspacing="5" width="100%" border="0"> <tr> {foreach from=$subcategories item=subcat} {if $tmp is div by 3} </tr> <tr><td colspan="3"></td></tr> <tr valign="top"> {/if} { if $tmp and $first_subcat ne "Y" } {assign var="tmp" value=0} {assign var="first_subcat" value="Y"} {/if} <td class="ColumnTitles" valign="top"><a title="{$subcat.description}" <a href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_web_dir}/default_image.gif{/if}" alt="" /><br> <font class="ItemsList">{ $subcat.category|escape }</font></a> {if $config.Appearance.count_products eq "Y"} {if $subcat.product_count}({ $subcat.product_count }) {elseif $subcat.subcategory_count}({ $subcat.subcategory_count }) {else} (0) {/if} {/if} {assign var="tmp" value=$tmp+1} {/foreach} </tr> </td> </table>

And thats it.

-------------------------------------------------------------

The default is 3 columns. But if you want to change the number of columns, then just change all the 3's to the number of columns you want in this line of code (from above):

4 column example (two number 3's was changed to 4):
Code:
{if $tmp is div by 4} </tr><tr><td colspan="4"></td></tr><tr valign="top"> {/if}

And also change the following line in skin1.css (from above) for the appropriate td width % (4 columns is 25%; 2 columns is 50%; etc.)

4 column example:
Code:
.ColumnTitles { TEXT-ALIGN: center; WIDTH: 25%; PADDING-LEFT: 5px; }

To keep the icons aligned evenly on the page , I created my sub-category icons (thumbnails) the same size as the 'No Image Available' image. This size is around 125 x 75 pixels. I've also attached screenshots for the 3 and 4 column displays below.

All the modifications above were made on templates that had no previous modifications. Hope you like it and thanks again to 27stars and mrkenzie.

- MoonDog -


Version 4.1.9 WORKS PERFECT THANKS MOON DOG




!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!WOOOOO HOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!
__________________
3.1
Reply With Quote
  #239  
Old 12-31-2007, 07:35 PM
 
Acquamarina Acquamarina is offline
 

X-Adept
  
Join Date: Aug 2006
Location: USA
Posts: 811
 

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

Moon Dog,

It works great except I get a dotted line around each item. Any way to change that?

Thanks! Happy 2008!
__________________
Vera B
4.4.5
CFLSystems.com mods, Kosmos eBay Integration, Feed Manager Pro, custom mods, BCSEngineering Mods, CDSEO PRO
Hosting by EWDHosting - The best home for your x-cart.
Reply With Quote
  #240  
Old 12-31-2007, 09:08 PM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

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

Hi Vera,

I was a little confused here, but I think you were referring to another post which is the 3 column layout with thumbnail for Related Products where I posted a modified related_products.tpl file.
I've added to that post as to how to change the dashed border around the products. Just click on the link above and it should take you there.

- MoonDog -
__________________
X-CART Gold v4.1.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 07:08 AM.

   

 
X-Cart forums © 2001-2020