Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

displaying category in search results

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-27-2002, 06:32 AM
 
ryan ryan is offline
 

Advanced Member
  
Join Date: Sep 2002
Location: Philly
Posts: 38
 

Default 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
Reply With Quote
  #2  
Old 11-30-2002, 08:36 AM
 
playcentral playcentral is offline
 

Member
  
Join Date: Nov 2002
Posts: 25
 

Default

i'd like that aswell
Reply With Quote
  #3  
Old 11-30-2002, 08:54 AM
 
playcentral playcentral is offline
 

Member
  
Join Date: Nov 2002
Posts: 25
 

Default

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>
Reply With Quote
  #4  
Old 12-01-2002, 07:50 AM
 
playcentral playcentral is offline
 

Member
  
Join Date: Nov 2002
Posts: 25
 

Default

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.
Reply With Quote
  #5  
Old 12-03-2002, 09:57 AM
 
ryan ryan is offline
 

Advanced Member
  
Join Date: Sep 2002
Location: Philly
Posts: 38
 

Default

Good job!

thanks
Reply With Quote
  #6  
Old 12-06-2002, 09:15 AM
 
playcentral playcentral is offline
 

Member
  
Join Date: Nov 2002
Posts: 25
 

Default

no problem
Reply With Quote
  #7  
Old 09-12-2007, 12:31 PM
 
ri_guy ri_guy is offline
 

Member
  
Join Date: Mar 2005
Posts: 13
 

Default 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
__________________
---------------------------
http://www.internetsimplicity.net
Effective Web Solutions
x-cart version: 4.0.12
Reply With Quote
  #8  
Old 09-14-2007, 10:27 AM
 
happymondays happymondays is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 3
 

Default 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
__________________
v????
Reply With Quote
  #9  
Old 09-18-2007, 08:51 AM
 
ri_guy ri_guy is offline
 

Member
  
Join Date: Mar 2005
Posts: 13
 

Default Re: displaying category in search results

Anybody?
__________________
---------------------------
http://www.internetsimplicity.net
Effective Web Solutions
x-cart version: 4.0.12
Reply With Quote
  #10  
Old 09-18-2007, 09:09 AM
 
happymondays happymondays is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 3
 

Default 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...
__________________
v????
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:06 AM.

   

 
X-Cart forums © 2001-2020