♥DAVID3733 Posted May 25, 2015 Share Posted May 25, 2015 Thank you bruyndoncx and Dan Cole I got it working, just in-case anyone else has the same issue here is the line below tep_draw_input_field('keywords', '', 'id="txtSearch" onkeyup="searchSuggest(event);" autocomplete="off" required placeholder="' . TEXT_SEARCH_PLACEHOLDER . '"' ) . '<div id="smartsuggest" ></div>' . '<span class="input-group-btn"><button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-search"></i></button></span>' . The problem I have now is the display of the searched phrases, there is no mouse over although if you click it it changes the search query to that, so all is working I assume its because I am using 2.3.4BS, I have added the CCS styles to the main CSS file as well as creating a new catalog/stylesheet.css, I assume the Javescript is working else it would not function Forgot to add I am using the search in the header so perhaps that is the issue, any pointers would be appreciated David Quote David Link to comment Share on other sites More sharing options...
mperbeils Posted August 4, 2015 Share Posted August 4, 2015 Great add on! But how to make the drop down list go away if I don´t want to seach for a produtc any more? The list with the suggestions doesn´t go away when mouse leave. Could someone put a "onmouseleave" function and show how to do it? Thanks very much Quote Link to comment Share on other sites More sharing options...
Kevin.Dallas Posted November 26, 2015 Share Posted November 26, 2015 i am having issues with a addon, XHR finished loading: GET "smartsuggest.php?keywords=w".(anonymous function) @ smartsuggest.js:74 smartsuggest.js:98 Uncaught TypeError: Cannot set property 'innerHTML' of null Quote Link to comment Share on other sites More sharing options...
Kevin.Dallas Posted December 1, 2015 Share Posted December 1, 2015 i am having issues with a addon, XHR finished loading: GET "smartsuggest.php?keywords=w".(anonymous function) @ smartsuggest.js:74 smartsuggest.js:98 Uncaught TypeError: Cannot set property 'innerHTML' of null Quote Link to comment Share on other sites More sharing options...
Kevin.Dallas Posted December 2, 2015 Share Posted December 2, 2015 (edited) a Edited December 2, 2015 by Kevin.Dallas Quote Link to comment Share on other sites More sharing options...
ArtcoInc Posted August 30, 2016 Share Posted August 30, 2016 @@mperbeils Great add on! But how to make the drop down list go away if I don´t want to seach for a produtc any more? The list with the suggestions doesn´t go away when mouse leave. Could someone put a "onmouseleave" function and show how to do it? Thanks very much Press the <Esc> key. Perhaps not intuitive, and obviously won't work on a touch-screen device. Malcolm Quote Link to comment Share on other sites More sharing options...
ArtcoInc Posted August 30, 2016 Share Posted August 30, 2016 @@DAVID3733 If you're still working on this, here's what I came up with ... function execute() { global $oscTemplate, $request_type; $content_width = MODULE_CONTENT_HEADER_SEARCH_CONTENT_WIDTH; $search_box = '<div class="searchbox-margin">'; $search_box .= tep_draw_form('quick_find', tep_href_link('advanced_search_result.php', '', $request_type, false), 'get', 'class="form-horizontal" id="frmSearch"'); $search_box .= ' <div class="input-group">'; $search_box .= tep_draw_input_field('keywords', '', 'id="txtSearch" onkeyup="searchSuggest(event);" autocomplete="off" required placeholder=" ' . TEXT_SEARCH_PLACEHOLDER . ' " ' , 'search'); $search_box .= ' <div id="smartsuggest" ></div>'; $search_box .= tep_draw_hidden_field('search_in_description', '1'); $search_box .= ' <a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"></a>' ; $search_box .= ' <span class="input-group-btn">' ; $search_box .= ' <button type="submit" class="btn btn-info">' ; $search_box .= ' <i class="fa fa-search"></i>' ; $search_box .= ' </button>' ; $search_box .= ' </span>' ; $search_box .= ' </div>'; $search_box .= tep_hide_session_id() . '</form>'; $search_box .= '</div>'; // MOD: BOF - SmartSuggest if (SMARTSUGGEST_ENABLED != 'false') { require(DIR_WS_CLASSES . 'smartsuggest.php'); $smartsuggest = new smartsuggest(); $smartsuggest->output($data); } // MOD: EOF - SmartSuggest Now, a question for everyone else ... In the above, after the user enters a search word, and the function returns the list of results, when the user clicks on one of the results, they are taken to the Advanced Search screen, with all of the same found results. Is it possible to change this so that they are taken directly to the selected product? Thanks Malcolm Quote Link to comment Share on other sites More sharing options...
♥Tsimi Posted August 30, 2016 Share Posted August 30, 2016 @@ArtcoInc Hi Malcolm I am absolutely not familiar with this SmartSuggest thing but isn't it similar to this addon by auzStar? http://addons.oscommerce.com/info/9351 From the addon description Clicking on or hitting enter on an item in the list will re-direct you to that product's info page. Quote Link to comment Share on other sites More sharing options...
ArtcoInc Posted August 30, 2016 Share Posted August 30, 2016 @@Tsimi Thank you! I am exploring several different Search add-ons to see which one I like best. I'll add that one to my list. One feature about -this- Search add-on is that it builds a new table of 'searched for words'. This allows me to see what people are searching for. I can then use this information to perhaps improve the wording in my product descriptions, etc. Like many things in life, I'd love to be able to take one feature from one add-on, and another feature from a different one, and ... Alas, I'm not that good of a programmer. Malcolm Tsimi and frankl 2 Quote Link to comment Share on other sites More sharing options...
fur Posted October 5, 2016 Author Share Posted October 5, 2016 Sorry for being absent and didn't solve the problem as mentioned above. Unfortunately I have left my previous position as osCommerce web developer and I afraid this plugin may not be able be maintained in future... Quote AdWords Dynamic Remarketing Tag - Tell Google What to Advertise [2.2.x] [2.3.x] AjaxCheckoutAddress - Change Address and Checkout in Once [2.2.x] SmartSuggest - Self-learning Ajax Search Suggestion [2.2.x] [2.3.x] More about me. Link to comment Share on other sites More sharing options...
ArtcoInc Posted October 5, 2016 Share Posted October 5, 2016 @@fur Did you see this thread? http://www.oscommerce.com/forums/topic/410166-search-add-on-reviews/ Malcolm Quote Link to comment Share on other sites More sharing options...
mperbeils Posted April 24, 2018 Share Posted April 24, 2018 On 29/08/2016 at 10:22 PM, ArtcoInc said: @@mperbeils Press the <Esc> key. Perhaps not intuitive, and obviously won't work on a touch-screen device. Malcolm After 3 years I got the solution lol /ext/javascript/smartsuggest.js //funcao para esconder div function esconder(div_value) { var esc = document.getElementById('smartsuggest'); esc.innerHTML = ''; } includes/boxes/search.php add onblur="javascript:esconder(this);" into the input field (call the function when the user clicks outsite the smartsuggest/seach box) $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'id="frmSearch"'), 'align' => 'center', 'text' => tep_draw_input_field('keywords', '', 'id="txtSearch" class="formbusca" onkeyup="searchSuggest(event);" onblur="javascript:esconder(this);" autocomplete="off" size="16" maxlength="30" style="width: ' . '190' . 'px"') . ' <div id="smartsuggest" ></div> ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br><div id="search-text">Use palavras-chave ou os 5 primeiros digitos do código da peça</div><br>'); Quote Link to comment Share on other sites More sharing options...
ArtcoInc Posted May 19, 2019 Share Posted May 19, 2019 A recent attack on one of my shops revealed that hackers will use the search function to try and gain access to the shop and/or database. Since SmartSuggest records search inquires to a database table, there is a possibility that this could be used in an attack Malcolm Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.