tigra111 Posted September 9, 2013 Share Posted September 9, 2013 Hi there, I am using prestashop 1.4 and the search box is all good (returning expected results) but above the results it says 'Search "ARRAY"' and not as it should say 'Search "chair" ' (chair being what I have typed in the search box and asked it to search for!) Can anybody help? Many Thanks Link to comment Share on other sites More sharing options...
vekia Posted September 9, 2013 Share Posted September 9, 2013 any chance to test this? if so, please share the url to your website. just wondering what theme you use Link to comment Share on other sites More sharing options...
tigra111 Posted September 9, 2013 Author Share Posted September 9, 2013 Yes thanks for reply. The web address is http://www.grangeandwoodhouse.com using theme: Rumah Batik Thanks Link to comment Share on other sites More sharing options...
vekia Posted September 9, 2013 Share Posted September 9, 2013 open search.tpl file located in your theme directory you should have there similar code: <h1 {if isset($instantSearch) && $instantSearch}id="instant_search_results"{/if}> {l s='Search'} {if $nbProducts > 0}"{if isset($search_query) && $search_query}{$search_query|escape:'htmlall':'UTF-8'}{elseif $search_tag}{$search_tag|escape:'htmlall':'UTF-8'}{elseif $ref}{$ref|escape:'htmlall':'UTF-8'}{/if}"{/if} {if isset($instantSearch) && $instantSearch}<a href="#" class="close">{l s='Return to the previous page'}</a>{/if} </h1> can you compare your code with this one? Link to comment Share on other sites More sharing options...
tigra111 Posted September 9, 2013 Author Share Posted September 9, 2013 I have compared my code with that of above and it is exactly the same. Really appreciating your help! Link to comment Share on other sites More sharing options...
vekia Posted September 9, 2013 Share Posted September 9, 2013 so we have a little problem right now! right before code (attached above) use this: search tag: {$search_tag|print_r}<br/> ref: {$ref|print_r} it's for test purposes only, but it will show us what exactly you've got in these variables Link to comment Share on other sites More sharing options...
tigra111 Posted September 9, 2013 Author Share Posted September 9, 2013 I have a confession to make - I have made a mistake!! (sorry)The code in my search.tpl file is NOT the same at all as yours (I had been looking at another file I had downloaded earlier when trying to solve)Here is the correct code on my server in the search.tpl file: {capture name=path}{l s='Search'}{/capture} {include file=$tpl_dir./breadcrumb.tpl} <h2>{l s='Search'} {if $nbProducts > 0}"{if $query}{$query|escape:'htmlall':'UTF-8'}{elseif $tag}{$tag|escape:'htmlall':'UTF-8'}{elseif $ref}{$ref|escape:'htmlall':'UTF-8'}{/if}"{/if}</h2> {include file=$tpl_dir./errors.tpl} {if !$nbProducts} <p class="warning"> {if $query} {l s='No results found for your search'} "{$query|escape:'htmlall':'UTF-8'}" {elseif $tag} {l s='No results found for your search'} "{$tag|escape:'htmlall':'UTF-8'}" {else} {l s='Please type a search keyword'} {/if} </p> {else} <p class="search_page">{$nbProducts|intval} {if $nbProducts == 1}{l s='result has been found.'}{else}{l s='results have been found.'}{/if}</p> {include file=$tpl_dir./product-sort.tpl} {include file=$tpl_dir./product-list.tpl products=$products} {include file=$tpl_dir./pagination.tpl} {/if} Link to comment Share on other sites More sharing options...
vekia Posted September 9, 2013 Share Posted September 9, 2013 search tag: {$tag|print_r}<br/> search query: {$query|print_r}<br/>ref: {$ref|print_r} use this code, and let me know what you see Link to comment Share on other sites More sharing options...
tigra111 Posted September 9, 2013 Author Share Posted September 9, 2013 search tag: {$tag|print_r}<br/> search query: {$query|print_r}<br/> ref: {$ref|print_r} use this code, and let me know what you see Hi, where abouts do I put this code? thanks Link to comment Share on other sites More sharing options...
vekia Posted September 9, 2013 Share Posted September 9, 2013 for example, right after {include file=$tpl_dir./breadcrumb.tpl} Link to comment Share on other sites More sharing options...
tigra111 Posted September 9, 2013 Author Share Posted September 9, 2013 i have done that and this is what I see when searching for 'chair': search tag: curtain81tag_level3Arraysearch query: 1ref: 1 Link to comment Share on other sites More sharing options...
tigra111 Posted September 9, 2013 Author Share Posted September 9, 2013 Hi Vekia, Can you shed any light? Thankyou Link to comment Share on other sites More sharing options...
vekia Posted September 9, 2013 Share Posted September 9, 2013 ohh it looks really strange, like problem with search controller (passing wrong variables to smarty) you can remove code that you added. here is a little workaround: instead this: <h2>{l s='Search'} {if $nbProducts > 0}"{if $query}{$query|escape:'htmlall':'UTF-8'}{elseif $tag}{$tag|escape:'htmlall':'UTF-8'}{elseif $ref}{$ref|escape:'htmlall':'UTF-8'}{/if}"{/if}</h2> use this code: <h2>{l s='Search'} {if $nbProducts > 0} {if $smarty.get.search_query} {$smarty.get.search_query|escape:'htmlall':'UTF-8'} {/if} {/if} </h2> 2 Link to comment Share on other sites More sharing options...
tigra111 Posted September 9, 2013 Author Share Posted September 9, 2013 That is great ! It works. I cant thank you enough, you are a real expert! I now get the correct search tag displaying before the results. ohh it looks really strange, like problem with search controller (passing wrong variables to smarty) you can remove code that you added. here is a little workaround: instead this: <h2>{l s='Search'} {if $nbProducts > 0}"{if $query}{$query|escape:'htmlall':'UTF-8'}{elseif $tag}{$tag|escape:'htmlall':'UTF-8'}{elseif $ref}{$ref|escape:'htmlall':'UTF-8'}{/if}"{/if}</h2> use this code: <h2>{l s='Search'} {if $nbProducts > 0} {if $smarty.get.search_query} {$smarty.get.search_query|escape:'htmlall':'UTF-8'} {/if} {/if} </h2> Link to comment Share on other sites More sharing options...
vekia Posted September 9, 2013 Share Posted September 9, 2013 glad that it works now im going to mark this topic as [solved] if you've got any questions - feel free to continue discussion here best regards 1 Link to comment Share on other sites More sharing options...
mouse1 Posted September 21, 2013 Share Posted September 21, 2013 ohh it looks really strange, like problem with search controller (passing wrong variables to smarty) you can remove code that you added. here is a little workaround: instead this: <h2>{l s='Search'} {if $nbProducts > 0}"{if $query}{$query|escape:'htmlall':'UTF-8'}{elseif $tag}{$tag|escape:'htmlall':'UTF-8'}{elseif $ref}{$ref|escape:'htmlall':'UTF-8'}{/if}"{/if}</h2> use this code: <h2>{l s='Search'} {if $nbProducts > 0} {if $smarty.get.search_query} {$smarty.get.search_query|escape:'htmlall':'UTF-8'} {/if} {/if} </h2> Thank you so much for this code, Vekia. My problem was that I got the search query result I had typed in the search box, but with no diacritics in my language. I used your code and now I'm getting perfect results including all special characters. Thank you, again. Jana Link to comment Share on other sites More sharing options...
vekia Posted September 21, 2013 Share Posted September 21, 2013 i kill two birds with one stone thanks for information, im really glad that it helped you best regards 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now