Jump to content
Latest News: (loading..)
fur

SmartSuggest - Self-learning Ajax Search Suggestion

Recommended Posts

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


David

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@@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


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release here

Share this post


Link to post
Share on other sites

@@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


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release here

Share this post


Link to post
Share on other sites

@@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.


When you ask for help/support:

  • Always state your osCommerce version
  • If possible, list up installed add-ons
  • 3rd party templates are not supported in the forum

Latest osC: osCommerce CE (Community Edition aka. Edge)

 

Share this post


Link to post
Share on other sites

@@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


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release here

Share this post


Link to post
Share on other sites

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...


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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×