![]() |
Displaying Category Name in a Product Description
I need to show the current Category Name within the product description. How can this be done.
Example: If a customer is in the following category... TV Repair Kits > Sony > KP-57WS500 The product description would automaticaly include the "KP-57WS500" category in the descrition like this... .................................................. ......... Sony Projection TV Repair Kit for model number "KP-57WS500" * Screen looks distorted, 3D, etc. * One or more colors can't be adjusted when when using the convergence menu. * Video looks bowed or warped |
Re: Displaying Category Name in a Product Description
Try this: in product.tpl insert
Code:
{$product.producttitle} for {$current_category.category} |
Re: Displaying Category Name in a Product Description
Thanks Steve,
That works but seems to be global. What I would like is to add this per product or per category. I may just add an if/then statement. Is there any way to put $current_category.category within the actual product description text? Ed |
Re: Displaying Category Name in a Product Description
Not sure if you insert $current_category.category directly into the descr will it work, try. Also you can try substitute - you can do like this: in description insert {{category_text}} where you want it to appear and then when you call the descr in product.tpl do like this
{$product.descr|substitute:"category_text":$curren t_category.category}. Not sure if this will work either :) |
Re: Displaying Category Name in a Product Description
I found this old post when trying to do the same thing... or close to. I want to have a simple link "Back to {Category Name}" on my product pages.
Here's what I came up with that works for me on 4.5.2 using the $location loop I found in breadcrumbs.tpl. I created a new language variable and made a custom breadcrumbs.tpl file which I call only for the product pages. {if $location} {foreach from=$location item=l name=location} {if $smarty.foreach.location.index == $smarty.foreach.location.total - 2} <div class="backtocat"> <div class="label"> <a href="{$l.1|amp}"><div class="icon"></div>{$lng.lbl_back_to} {$l.0}</a> </div> </div> {/if} {/foreach} {/if} |
All times are GMT -8. The time now is 05:42 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.