Jump to content

Is there any free module for embedding Google Custom Search?


Guest

Recommended Posts

Hi,

 

Because the built search module of PS doesn't do well for me on my shop; So, I am trying to embed Google Custom Search Engine to my shop.

 

I have the code to paste already, but before replacing the code- I wonder if anyone has done this before and made a free module for this? I'll be happier to install a module instead of editing the code.

Link to comment
Share on other sites

I am trying to put the code into file blocksearch-top.tpl but I got an error, someone pls help.

 

Here is the content:

 

<div id="search_block_top">
<form method="get" action="{$link->getPageLink('search.php')}" id="searchbox">
 <label>{l s='Search' mod='blocksearch'}</label>
 <input class="search_query" type="text" id="search_query_top" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
 <a href="javascript:document.getElementById('searchbox').submit();">{l s='Go!' mod='blocksearch'}</a>
 <input type="hidden" name="orderby" value="position" />
 <input type="hidden" name="orderway" value="desc" />
 {*<input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />*}
</form>

//--Google Code I'm trying to put in
<div id="cse" style="width: 100%;">Loading</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
 google.load('search', '1', {language : 'vi', style : google.loader.themes.V2_DEFAULT});//--Error here!
 google.setOnLoadCallback(function() {
   var customSearchOptions = {};  var customSearchControl = new google.search.CustomSearchControl(
  '007586913721386042342:ntdd5xsdgb0', customSearchOptions);
   customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
   customSearchControl.draw('cse');
 }, true);
</script>

</div>

Link to comment
Share on other sites

Well, I've edited and the code it works but I still have an issue with listing the results, please take a look at attachment for details.

 

Hope to hear some ideas from you all.

post-305386-0-85852900-1333968853_thumb.png

Link to comment
Share on other sites

  • 3 months later...

I've already tried that and it resulted in a blank page. Those instructions don't make sense. It's mostly screenshots of how to set up Google Search Engine and then very vague "try if it will work when you paste code here and then find this code somewhere".

 

 

This guy seems to have it,

http://www.prestaliv...prestashop.html

 

I didn't try it. Hopefully it helps.

Link to comment
Share on other sites

  • 4 years later...
×
×
  • Create New...