panatan Posted August 15, 2012 Share Posted August 15, 2012 Hi all and first sorry for my poor English, With the following code i would like to add the word "search" in the search field of Prestashop. <input id="searchbox" type="text" onblur="if (this.value == '') {this.value = 'Rechercher';}" onfocus="if (this.value == 'Rechercher') {this.value = '';}" name="s" value="Search"> When focus is placed in the search field, Search word disapears and it (generally) works fine. But if this code is added to Prestashop code, i get a blank page... Does anybody have a suggestion ? Regards Link to comment Share on other sites More sharing options...
tdr170 Posted August 15, 2012 Share Posted August 15, 2012 Changes the way Search block works - when you click in text box, Search... auto hides modules/blocksearch/blocksearch-top.tpl Change this <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}" /> To this <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}{else}{l s='Search entire store...' mod='blocksearch'}{/if}" onfocus="if(this.value=='{l s='Search entire store...' mod='blocksearch'}')this.value='';" onblur="if(this.value=='')this.value='{l s='Search entire store...' mod='blocksearch'}';" /> You can change the value in red to your liking... 3 Link to comment Share on other sites More sharing options...
panatan Posted August 17, 2012 Author Share Posted August 17, 2012 Hi tdr170 => works fine now !!! Thx a lot ! best regards Link to comment Share on other sites More sharing options...
miriama Posted July 20, 2013 Share Posted July 20, 2013 Hi tdr170, thank you very much for your solution, it works for me too!!! I need one more information: since I have a multilanguage shop is it possible to change the text in the field search according with the selected language? Thank you in advance, Regards Miriam Link to comment Share on other sites More sharing options...
Recommended Posts