Guest Posted April 9, 2012 Share Posted April 9, 2012 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 More sharing options...
Guest Posted April 9, 2012 Share Posted April 9, 2012 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 More sharing options...
Guest Posted April 9, 2012 Share Posted April 9, 2012 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. Link to comment Share on other sites More sharing options...
Guest Posted April 10, 2012 Share Posted April 10, 2012 Well, I'm learning to write a PS module! If you have ideas to make this works please share! Link to comment Share on other sites More sharing options...
aliaspt Posted July 14, 2012 Share Posted July 14, 2012 Looking for this solution as well. Link to comment Share on other sites More sharing options...
Bill Dalton Posted July 15, 2012 Share Posted July 15, 2012 This guy seems to have it, http://www.prestalive.com/blog/tutorials/1-how-to-embed-google-custom-search-in-prestashop.html I didn't try it. Hopefully it helps. 1 Link to comment Share on other sites More sharing options...
aliaspt Posted July 15, 2012 Share Posted July 15, 2012 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 More sharing options...
Shashikant N Sharma Posted September 18, 2016 Share Posted September 18, 2016 I have been able to use Google Custom search bar through HTML box developed by Vekia at https://mypresta.eu/ I have implemented it at https://edupediapublications.org Link to comment Share on other sites More sharing options...
Recommended Posts