Adding a link to category from product listing
One of my clients would like to have a link to a product's category in the product listing (customer/main/products_t.tpl). It would be similar to the featured products seen on this site: http://www.ncix.com/ - See how it says "More Processors" etc and links to the category? Does anyone know the smarty code to do this?
The cart version is 4.1.1 Thanks!! |
Good idea
I would be interested in that too. Anyone have a suggestion?
Jamie xcartpro 4.1.1 [unix] |
Re: Adding a link to category from product listing
Anyone have an answer for this....what variable would be used to add the category name to the featured products or products listing for 4.1.x?
Thanks, Louise |
Re: Adding a link to category from product listing
Hi All,
I would like to do this same thing (get a hold of the category name / id and use it in my featured products listing). Does anyone know how to alter the product query to include the stinking category of the product in the product array?!?!? |
Re: Adding a link to category from product listing
Also searching for this... A shitload of junk in the smarty variables, yet a simple category of the product nowhere to be found!
|
Re: Adding a link to category from product listing
Here is a quick mod for this:
1. create a new Smarty modifier plugin -> "include/templater/plugins/modifier.getproductmaincat.php" with the following content: PHP Code:
2. add something like this: Code:
<a href="home.php?cat={$products[product].productid|getproductmaincat}">{$lng.lbl_more}</a> anywhere inside main section loop in the "skin1/customer/main/products_t.tpl" template. e.g. right before this code -> {*** Uncomment it if you need 'Buy Now' button *** |
Re: Adding a link to category from product listing
This didn't work for me. :\
On my 4.1.10 build I was able to use the following: {$current_category.category} on product.tpl but on my 4.4 evaluation its not working. I need to show the category link on the product page. Is there any way to do this? |
Re: Adding a link to category from product listing
Has anyone been able to show the category name on product.tpl in 4.4x?
|
Re: Adding a link to category from product listing
1. create a new Smarty modifier plugin -> "include/templater/plugins/modifier.getcatnamebyid.php" with the following content:
PHP Code:
2. add something like this: Code:
{$smarty.get.cat|getcatnamebyid} into the "skin/common_files/customer/main/product.tpl" template. |
Re: Adding a link to category from product listing
Hi Alex,
Thanks for the idea. Unfortunately this solution doesn't seem to output anything though. |
All times are GMT -8. The time now is 04:24 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.