X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   displaying category in search results (https://forum.x-cart.com/showthread.php?t=808)

ryan 11-27-2002 06:32 AM

displaying category in search results
 
I'd like to make it so when someone does a search the results display the category for each product. We sell dvd and vhs so a search result could have the exact same title so it would be nice if the category was displayed also. I was able to make it show up in the category listing page pretty easily, but it doesn't work for the search results page. Any help would be appriciated.

thanks
Ryan

playcentral 11-30-2002 08:36 AM

i'd like that aswell :(

playcentral 11-30-2002 08:54 AM

ok, just figured it out....

add this line : {$products[product].category | escape}

ie. in /customer/main/products.tpl

<font class=TableCenterProductTitleBlack>{$lng.lbl_categ ory}: {$products[product].category | escape}</font>
<font class=TableCenterProductTitleOrange>{$lng.lbl_our_ price}: {include file="currency.tpl" value=$products[product].price}</font>

playcentral 12-01-2002 07:50 AM

just found that if you have featured products then it doesn't display the category and leaves it blank which doesn't look good, you can remove the category txt if their isn't a category for the item ie. featured products, using the if command

eg.

{if $products[product].category ne ""}<font class=TableCenterProductTitleBlack>
{$lng.lbl_category}: {$products[product].category | escape}</font>
{/if}


Hope this helps ya. :)

ryan 12-03-2002 09:57 AM

Good job!

thanks

playcentral 12-06-2002 09:15 AM

no problem :)

ri_guy 09-12-2007 12:31 PM

Re: displaying category in search results
 
Hmmm... I just tried this and it didn't work. I'm using version 4.1.3. I tried adding {$products[product].category | escape} to customer/main/products.tpl and nothing is displayed.

Also, is there a way to show the category breadcrumbs for each result. For instance: Main Category > Sub Cat 1 > Sub Sub Cat 10

Thanks!
Ian

happymondays 09-14-2007 10:27 AM

Re: displaying category in search results
 
I'd like to know the answer as well, since the abovementioned code doesn't work for me either.
Thanks

ri_guy 09-18-2007 08:51 AM

Re: displaying category in search results
 
Anybody?

happymondays 09-18-2007 09:09 AM

Re: displaying category in search results
 
We received the answer below.

>>
I have examined your cart and fixed the problem. The thing was that the "skins/default/en/main.tpl" file was modified a bit incorrectly. The case-sensitive parameter "showLocationPath" was renamed to "showlocationpath". As a result, the flag to display location path was not passed to the necessary template.
<<

Check your tpl. Perhaps you have the same typo there...


All times are GMT -8. The time now is 01:30 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.