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

Show search keywords in description of product

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 11-12-2008, 10:51 AM
  Warwick's Avatar 
Warwick Warwick is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Somewhere on the web through European connection
Posts: 868
 

Default Re: Show search keywords in description of product

Well I did but it only works when you have the smart search mod from alteredcart installed ... if you do I can quote the code needed.

p.s. the mod isn't needed to get this working but I haven't got the old code (anymore) ...
__________________
Installs: X-Cart 4.1.x - 4.4.x ∙∙ MySQL version: 5.0.45 ∙∙ Apache version: 2.2.8 (Unix) ∙∙ PHP version: 5.25
X-Cart add-ons: all ∙∙ Mods: A lot; too many ∙∙ Skin templates: Many
∙∙ Experience: Somewhere beyond newbie
-----------------------------------
------------------------------------------------------------------------------------------------------
Looking for the best dutch language pack? 4.1.x - 4.6.x compatibel, native speaker translation! More info
Reply With Quote
  #12  
Old 05-11-2010, 05:09 PM
 
TheWrongGrape TheWrongGrape is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: Los Angeles, CA
Posts: 68
 

Default Re: Show search keywords in description of product

Got this working on 4.3.1. I'm using my Search Keywords as "Tags" to encourage customers to browse more.

After searching for clickable search keywords, I got a lot of help from this thread by wjbrewer.

Please read that over first.

Firstly, I didn't need to mod my search so you can ignore the part about that.

In product.php, where wjbrewer indicated, I pasted in:

Code:
$keywords = split(",", $product_info['keywords']); $smarty->assign('keywords', $keywords);

The above is different from what wjbrewer originally posted in that it recognizes that my keywords are comma-separated and will break them up as such, including keyword phrases that consist of more than one word with spaces in between.

Then in my template where I want the keywords to show up (/customer/main/products_details.tpl in my case), I put in the following which will return my keywords on one line, followed by a pipe symbol (except for the last value) and each will be turned into a link:

Code:
{if $product.keywords ne ""} Tags: {foreach from=$keywords item=keyword name=kw} <a href="../search.php?mode=search&by_title=Y&by_descr=Y&by_sku=Y&search_in_subcategories=Y&including=all&substring={$keyword}">{$keyword}</a> {if !$smarty.foreach.kw.last}| {/if} {/foreach}{/if}

The end result looks like this:

Tags: Feminine | Floral | Sweet and Sassy

Hope this helps someone!
Reply With Quote
  #13  
Old 10-19-2010, 04:49 AM
 
nickff nickff is offline
 

Senior Member
  
Join Date: Aug 2010
Posts: 132
 

Default Re: Show search keywords in description of product

Hello,

I am looking to do something similar, but instead of the keywords appearing on the product pages themselves, I am wanting to create a page with all of the keywords entered across the site. Other than that, the same fuctionality (clickable tags that take you to a results page with the products associated with that tag).

Any ideas on how to implement this on it's own page? Let me know, thanks!
__________________
nick hoag
looking forward to the future
http://thefutureforward.com
xcart versions 4.2.x, 4.3.x, 4.4.x
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 07:25 PM.

   

 
X-Cart forums © 2001-2020