| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Subcategory text & images for x-cart 4.1.5 | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Subcategory text & images for x-cart 4.1.5
Instead of just the un-glorious text for subcats, here is a working addition to the latest x-cart version 4.1.5
3 files to change: /skin1/customer/main/subcategories.tpl /includes/categories.php skin1/skin1.css O.K here we go, open up /skin1/customer/main/subcategories.tpl and at around line 17 look for the beginning that looks like this, {if $subcategories}. We are going to paste in the following code that goes to about line 44 over the top of it, take notice of the blue highlight, this has been changed as previous versions with [IMG] brackets cause no images to displayed with image links. {if $subcategories} <table cellspacing="5" width="100%" border="0">
<tr>
{foreach from=$subcategories item=subcat} {if $tmp is div by 2}
</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}" href="home.php?cat={ $subcat.categoryid }"><img src="{if $subcat.icon_url}{$subcat.icon_url}{else}{$xcart_w eb_dir}/default_image.gif{/if}" alt="" /> <font class="ItemsList">{ $subcat.category|escape }</font></a>
{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} {else} 0 Products {/if} {/if} {assign var="tmp" value=$tmp+1} {/foreach} </table> {/if} NEXT open /includes/categories.php and find this 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);
REPLACE WITH $_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);
LAST THING TO DO IS open skin1/skin1.css and add to the bottom of the css file the folowing as it is;
.ColumnTitles {
padding-left: 5px;
text-align: center;
width: 33%; }
Thats it, please do not forget to add your image if you require one. One tip that i have not worked out yet is that if you use the following in 'div by 2' in /skin1/customer/main/subcategories.tpl it throws the text out a bit if you do not use that same image size, so i kept mine at 2, you can of course use less or more colums.
{foreach from=$subcategories item=subcat} {if $tmp is div by 2} </tr><tr><td colspan="3"></td></tr><tr valign="top"> Hope this helps
Richard
|
|||||||||
#2
|
|||||||
|
|||||||
Re: Subcategory text & images for x-cart 4.1.5
Dear Richard:
This mod, looks great. I did the three steps, but the subcategories are showing in one column. The code to show two columns not work for me; Can you explain a little bit better in the form "old code" >> "new code". Sorry to ask this simple question, but I'm not an expert in this codes. Thank you Moses X-cart 4.1
__________________
x-cart V4.4.4 Smart Template CDSEO Unix |
|||||||
#3
|
|||||||
|
|||||||
Re: Subcategory text & images for x-cart 4.1.5
Quote:
Dear Richard: This mod, looks great. I did the three steps, but the subcategories are showing in one column. The code to show two columns not work for me; Can you explain a little bit better in the form "old code" >> "new code". Sorry to ask this simple question, but I'm not an expert in this codes. Thank you Moses X-cart 4.1
__________________
x-cart V4.4.4 Smart Template CDSEO Unix |
|||||||
#4
|
|||||||
|
|||||||
Re: Subcategory text & images for x-cart 4.1.5
aaaaaaaaarrrrrrrrrgggggggggggghhhhhhhhhhhh!
I cant find this code: NEXT open /includes/categories.php and find this 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);
__________________
Running stores using the following: 2@ Version 4.0.19 2@ Version 4.1.9 1@ Version 4.1.11 |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Subcategory text & images for x-cart 4.1.5
Quote:
Line 122 just below Code:
|
|||||||||
#6
|
|||||||
|
|||||||
Re: Subcategory text & images for x-cart 4.1.5
Ok, I think I am being a complete plonker here....... It doesnt say that in my code ...... how do I tell which version I am using as I bought it via a hosting co. and they transferred the license to me ..... I know that is an eye rolling dummy question. I thought it was 4.1.5 but maybe I am wrong ?!
__________________
Running stores using the following: 2@ Version 4.0.19 2@ Version 4.1.9 1@ Version 4.1.11 |
|||||||
#7
|
|||||||
|
|||||||
Re: Subcategory text & images for x-cart 4.1.5
forget it ...... found it.....version 4.0.19
*sigh* Will this mod still work?
__________________
Running stores using the following: 2@ Version 4.0.19 2@ Version 4.1.9 1@ Version 4.1.11 |
|||||||
#8
|
|||||||
|
|||||||
Re: Subcategory text & images for x-cart 4.1.5
Bump ....
Anyone help me with getting images in my subcategories please? This is how it is looking so far: http://www.partypresence.co.uk/store/home.php?cat=248 Thanks
__________________
Running stores using the following: 2@ Version 4.0.19 2@ Version 4.1.9 1@ Version 4.1.11 |
|||||||
#9
|
|||||||
|
|||||||
Re: Subcategory text & images for x-cart 4.1.5
OK, pulling my hair out now I even tried to add this
Code:
__________________
Running stores using the following: 2@ Version 4.0.19 2@ Version 4.1.9 1@ Version 4.1.11 |
|||||||
#10
|
|||||||||
|
|||||||||
Re: Subcategory text & images for x-cart 4.1.5
Hello
You may wish to look over the forum as like i have stated this works with 4.1.x not your version as there is more than likely some text difference. Richard |
|||||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|