Not for official support
We do not provide technical support in this forum.
If you want to contact our customer support, please use our support form.
You are not logged in.
Hi all, I know this may be a long shot but have been scratching my head about this one for a while.
Does anyone know/have done the following:
In the category page, I want to have the sub categories listed using their respective logos, and not the text link name.
Is this even do-able?
Thanks all.
D
Offline
1. In file core_functions/category_functions.php change line
$q = db_query("SELECT categoryID, name, products_count FROM ".
CATEGORIES_TABLE." WHERE parent='$categoryID' order by sort_order, name");to
$q = db_query("SELECT categoryID, name, products_count, picture FROM ".
CATEGORIES_TABLE." WHERE parent='$categoryID' order by sort_order, name");2. In file templates/frontend/tmpl*/category.tpl.html change line
<a class=standard href="index.php?categoryID={$subcategories_to_be_shown[i][0]}">{$subcategories_to_be_shown[i][1]}</a>to
<a class=standard href="index.php?categoryID={$subcategories_to_be_shown[i][0]}">{if $subcategories_to_be_shown[i].picture ne ''}<img src="products_pictures/{$subcategories_to_be_shown[i].picture}"> {/if}{$subcategories_to_be_shown[i][1]}</a>Offline
You sir, are my new best friend!!!
Thanks heaps, that worked a treat!
D
Offline
I have followed advice on this forum and managed to get sub-cat images alongside the sub-cat name but the length of the name defines where the image is placed so that they are unaligned. Any ideas as to how to have the image before the file name, or even better have them presented in the same way as the products (ie images side by side with name below)?
Also, if I set the main category not to show sub-cat products I get '<no products> text - any ideas how to get rid of this?
Thanks in advance for any help,
Neil.
Offline
1. Change the HTML markup in file templates/frontend/tmpl*/category.tpl.html here:
<a class=standard href="index.php?categoryID={$subcategories_to_be_shown[i][0]}">{$subcategories_to_be_shown[i][1]}</a>
({$subcategories_to_be_shown[i][2]})<br>to make links to subcategories look the way you need.
2. Remove line
< {$smarty.const.STRING_EMPTY_CATEGORY} >in that file.
Offline
Point 2 sorted - great, thankyou.
I cannot find the code you refer to for point 1 though. Also, could you advise me as to what to change it to to get the sub-cats to appear in the same layout (3 abreast) as the products?
Thanks for your help,
Neil.
Offline
Change code
{section name=i loop=$subcategories_to_be_shown}
<a class=standard href="index.php?categoryID={$subcategories_to_be_shown[i][0]}">{$subcategories_to_be_shown[i][1]}</a>
({$subcategories_to_be_shown[i][2]})<br>
{/section}to
{assign var=columns value=3}
<table>
{section name=i loop=$subcategories_to_be_shown}
{if $smarty.section.i.index is div by $columns}<tr>{/if}
<td>
<a class=standard href="index.php?categoryID={$subcategories_to_be_shown[i][0]}">
{$subcategories_to_be_shown[i][1]}
</a>
({$subcategories_to_be_shown[i][2]})
</td>
{if $smarty.section.i.index+1 is div by $columns}</tr>{/if}
{/section}
</table>Offline
Thanks, but I still can't find the code you mention - don't want to change anything that I shouldn't.
I am looking in
/home/sciarti1/public_html/published/SC/html/scripts/templates/frontend/category.tpl.html
and the closest code I can find is:
<div id="cat_info_left_block">
{* description *}
{$selected_category.description}
{if $subcategories_to_be_shown}
{* show subcategories *}
<p>{section name=i loop=$subcategories_to_be_shown}
{if $subcategories_to_be_shown[i][3]}
{assign var=_sub_category_url value="?categoryID=`$subcategories_to_be_shown[i][0]`&category_slug=`$subcategories_to_be_shown[i][3]`"|set_query_html}
{else}
{assign var=_sub_category_url value="?categoryID=`$subcategories_to_be_shown[i][0]`"|set_query_html}
{/if}
<a href="{$_sub_category_url}">{$subcategories_to_be_shown[i][1]}
{if $subcategories_to_be_shown[i].picture ne ""}<img src="{$smarty.const.URL_PRODUCTS_PICTURES}/{$subcategories_to_be_shown[i].picture}">{/if}
</a>
({$subcategories_to_be_shown[i][2]})<br>
{/section}</p>
{/if}
</div>
Thanks for you help so far, but could you advise me as I am not sure what to change.
Thanks,
Neil.
Offline
It is because you have posted your question in the wrong forum section. Customization of WebAsyst Shop-Script templates is discussed in http://forum.webasyst.net/viewforum.php?id=11. Look here: http://forum.webasyst.net/viewtopic.php?id=2904
Offline