| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Displaying Category Name in a Product Description | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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
__________________
Xcart 4.2.1 Xcart 4.1.9 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Displaying Category Name in a Product Description
Try this: in product.tpl insert
Code:
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||
|
|||||||
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
__________________
Xcart 4.2.1 Xcart 4.1.9 |
|||||||
#4
|
|||||||||
|
|||||||||
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
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||
|
|||||||
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}
__________________
X-Cart 4.5.2 Gold Live X-Cart 4.7.3 Gold Dev |
|||||||
|
|||
X-Cart forums © 2001-2020
|