Add Related Category's Icon to SmartSearch results
I'm trying to modify SmartSearch to display a grid layout of related categories with their respective category icon.
I've figured out what file to edit: /common_files/modules/Smart_Search/smart_search.tpl and where to put the code: below Code:
{section name=rc loop=$related_categories max=$rcmax} But I don't know how to get the url for the category icon. I tried this code that I found in /common_files/customer/main/subcategories_t.tpl Code:
{get_category_image_url} Any help would be much appreciated! Once I figure it out, I'll post what I've done. I feel this is a superior way to display the related categories as most people's eyes are drawn to images rather than text. THANKS! |
Re: Add Related Category's Icon to SmartSearch results
OK, so nobody has an answer to this, but how about a simple question:
How do you get a category's Icon (image) only from the CategoryID? The smartSearch PHP file "_searcy.php" already includes common.php, which sounds to me like where the category functions are supposed to be, but the {get_category_image_url category=????} doesn't seem to work. Is there some other file I need to include? |
Re: Add Related Category's Icon to SmartSearch results
SmartSearch is not a module supplied with XC by default. It is a paid one. You could get answers only from those who are using it.
|
Re: Add Related Category's Icon to SmartSearch results
ADDISON, thanks for the reply. I know it's not a stock X-Cart module, but I figured there would be enough people on this forum that have used and/or modified the SmartSearch mod that might be able to help. I refuse to give up hope!
THANKS! |
Re: Add Related Category's Icon to SmartSearch results
OK. Figured it out. Really not that hard.
Within the section that starts Code:
{if $related_categories} Change Code:
<a href="home.php?cat={$related_categories[rc].categoryid}">{$related_categories[rc].category}</a> to Code:
<a href="home.php?cat={$related_categories[rc].categoryid}"><img src="{$xcart_web_dir}/image.php?id={$related_categories[rc].categoryid}&type=C" alt="{$related_categories[rc].category|escape}" /><br />{$related_categories[rc].category}</a> Now, I also got rid of the <ul> and made it a grid format copying section info from the manufacturer_categories template. |
Re: Add Related Category's Icon to SmartSearch results
Nice!
If you are storing images in the filesystem (recommended) then try to avoid using image.php as enough requests like that on a busy page could cause server load to go up. Instead, try to find a way to reference the actual image path. |
All times are GMT -8. The time now is 05:47 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.