Ray UK Posted December 3, 2013 Share Posted December 3, 2013 This problem, along with others, seemed to occur after setting our store to multistore, finding bugs with multistore, and then disabling multistore. If you go to our site, and in the search type banana and don't press search/enter. The drop down shows the 2 products with images fine, but the results showing below have lost their formatting Yet when you press enter to complete the search, the search results are fine. Link to comment Share on other sites More sharing options...
vekia Posted December 3, 2013 Share Posted December 3, 2013 ajax search display small tooltip with search results near search field. it's not related to product_list.css you're talking about instant serach results? or what? Link to comment Share on other sites More sharing options...
Ray UK Posted December 3, 2013 Author Share Posted December 3, 2013 (edited) ahh sorry vekia, I always get the 2 search's the wrong way round Yes the ajax is working, but the instant search results have no formatting to them. You can test and see here www.no-match.co.uk Thanks pic of problem also attached Edited December 3, 2013 by MerseyRay (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 4, 2013 Share Posted December 4, 2013 problem is related to code, css works well but somehow code was generated outside the "product_list" <ul> element. can you show contents of modules/blocksearch/blocksearch-instantsearch.tpl file ? Link to comment Share on other sites More sharing options...
Ray UK Posted December 4, 2013 Author Share Posted December 4, 2013 Thanks Vekia. Here is my code {if $instantsearch} <script type="text/javascript"> // <![CDATA[ function tryToCloseInstantSearch() { if ($('#old_center_column').length > 0) { $('#center_column').remove(); $('#old_center_column').attr('id', 'center_column'); $('#center_column').show(); return false; } } instantSearchQueries = new Array(); function stopInstantSearchQueries(){ for(i=0;i<instantSearchQueries.length;i++) { instantSearchQueries[i].abort(); } instantSearchQueries = new Array(); } $("#search_query_{$blocksearch_type}").keyup(function(){ if($(this).val().length > 0){ stopInstantSearchQueries(); instantSearchQuery = $.ajax({ url: '{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}', data: { instantSearch: 1, id_lang: {$cookie->id_lang}, q: $(this).val() }, dataType: 'html', type: 'POST', success: function(data){ if($("#search_query_{$blocksearch_type}").val().length > 0) { tryToCloseInstantSearch(); $('#center_column').attr('id', 'old_center_column'); $('#old_center_column').after('<div id="center_column" class="' + $('#old_center_column').attr('class') + '">'+data+'</div>'); $('#old_center_column').hide(); $("#instant_search_results a.close").click(function() { $("#search_query_{$blocksearch_type}").val(''); return tryToCloseInstantSearch(); }); return false; } else tryToCloseInstantSearch(); } }); instantSearchQueries.push(instantSearchQuery); } else tryToCloseInstantSearch(); }); // ]]> </script> {/if} {if $ajaxsearch} <script type="text/javascript"> // <![CDATA[ $('document').ready( function() { $("#search_query_{$blocksearch_type}") .autocomplete( '{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}', { minChars: 3, max: 20, width: 90, height: 300, selectFirst: false, scroll: true, dataType: "json", formatItem: function(data, i, max, value, term) { return "<img src=\"" + baseDir + "img/tmp/" + "product_mini_" + data.id_product + ".jpg\" alt=\"" + value + "\" />" + value; }, parse: function(data) { var mytab = new Array(); for (var i = 0; i < data.length; i++) mytab[mytab.length] = { data: data[i], value: data[i].cname + ' ><br /> ' + data[i].pname }; return mytab; }, extraParams: { ajaxSearch: 1, id_lang: {$cookie->id_lang} } } ) .result(function(event, data, formatted) { $('#search_query_{$blocksearch_type}').val(data.pname); document.location.href = data.product_link; }) }); // ]]> </script> {/if} Now dreamweaver is highlighting line 26 in red, which is this line: url: '{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}', cant find the :after in there anywhere Thanks Link to comment Share on other sites More sharing options...
Ray UK Posted December 4, 2013 Author Share Posted December 4, 2013 If it is easy to disable Instant search results then I don't mind doing that. I have tried turning it off in the BO but it makes no difference. So I would be happy just Deleting the code that activates the instant search results, and keep the ajax search Link to comment Share on other sites More sharing options...
Ray UK Posted December 4, 2013 Author Share Posted December 4, 2013 (edited) I have noticed that the Search Results Div, and the Instant Search Results Div are different ? See pic Yet they are both loaded from product-list.tpl ? Edited December 4, 2013 by MerseyRay (see edit history) Link to comment Share on other sites More sharing options...
Ray UK Posted January 10, 2014 Author Share Posted January 10, 2014 I have still not managed to resolve this. Does anybody know why the instant search isn't using the css, or using a different css/template ? Link to comment Share on other sites More sharing options...
Ray UK Posted January 10, 2014 Author Share Posted January 10, 2014 I have just copied the original unmodified blocksearch-instantsearch.tpl to mytheme/modules/blocksearch/blocksearch-instantsearch.tpl and the results are still the same 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