Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SmartSuggest - Self-learning Ajax Search Suggestion


fur

Recommended Posts

About

This add-on is based on SimpleSuggest, adding a search suggestion to your OsCommerce search box, but it also records each customers' searched keywords and sort the result products order by popular search, or even simply show the result in term of popular keywords.

 

It also gives the ability to search in multiple keywords using AND/OR.

 

Options can be set in Admin and automatically install and deal with database.

 

By setting search type 'products' and sort by 'products', it works just like SimpleSuggest, but you can also sort the resulting products by 'keywords' - it's searched count. Or simply put search type to 'keywords' so it works as a self-learn search engine which gives the pass searched keywords (make sure you have enough saved search keywords before turn this on)

 

ScreenShot

http://richardfu.net/wp-content/uploads/2013/10/screenshot_1_search_suggest.jpg

Search suggestion using or and multiple words

 

http://richardfu.net/wp-content/uploads/2013/10/screenshot_2_admin_configuration.jpg

Admin configuration

 

http://richardfu.net/wp-content/uploads/2013/10/screenshot_3_stats_report.jpg

Stats keyword searched

 

2.2.x Add-on page

 

2.3.x Add-on page

Edited by Jan Zonjee
remove external link

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

Thanks for the module. However, it looks incomplete.

 

Configuration menu as well as installation of searched_keywords table are missing.

 

I manually created the searched_keywords table as much columns that I could find used in scripts however, no search is being recorded into the table.

 

Something is not right.

Edited by hiorti
Link to comment
Share on other sites

Hi, all configuration column and searched_keywords should be auto-added once the search box get loaded (that is, simply load your public front page)...

I have already tested it and please do give some feedback if that doesnt work for you...

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

Call your store where search box is appeared in your favorite browser! The contribution should be functional out of the box and all database settings will be installed automatically on first page request. The contribution has an intelligent database installer that detects whether the proper settings are present and if not will install them.

 

I am rewriting the instruction in HTML so people can follow... keep an eye to the new update...

 

For those still cant work, please let me know your osc version and your website so I can fix it, thanks.

Edited by fur

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

or for those who losing their patient, here's the sql:

smartsuggest.sql.zip

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

Hi

 

when i choose Suggest results type

Product Names

 

 

I;ve this bug

 

1064 - Something is wrong in your syntax obok 'keywords' w where clauseSELECT pd.products_name as result%' or pd.products_name ' w linii 1

select p.products_id from products p left join products_description pd on p.products_id = pd.products_id where ( pd.products_head_keywords_tag like '%1054 - Nieznana kolumna 'keywords' w where clauseSELECT pd.products_name as result%' or pd.products_name like '%1054 - Nieznana kolumna 'keywords' w where clauseSELECT pd.products_name as result%' ) and p.products_status = 1 and pd.language_id = 1 limit 1

[TEP STOP]

Link to comment
Share on other sites

I don't get any suggestion .

I run the sql querry , got the configuration options . The smartsuggest is enabled , i can see what keywords had been searched but on front page i don't get any suggestion .

I did all the steps from installation guide .

My osc version is 2.3.1 and my site is www.ecig-vapo.com

 

Any suggestion ?

Link to comment
Share on other sites

emcmoda,

thx for posting the errors, just try to consolidate your post and not spam here.

for your problem, my bad put a buggy file, Please update all files to v1.0.2 and it should work.

 

 

cretbogdan,

I cannot see your site using the addon, but my best guess is you are using the old version too, please update all files to v1.0.2, and sure you customized your header search box follow what's in includes/modules/boxes/bm_search.php

Edited by fur

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

emcmoda,

thx for posting the errors, just try to consolidate your post and not spam here.

for your problem, my bad put a buggy file, Please update all files to v1.0.2 and it should work.

 

 

cretbogdan,

I cannot see your site using the addon, but my best guess is you are using the old version too, please update all files to v1.0.2, and sure you customized your header search box follow what's in includes/modules/boxes/bm_search.php

 

Hi

 

I apologize for my unnecessary post

 

Thanks for your solution

 

I change the place bm_search.php on my page is invisible

 

 

I notes that if we have double search form, suggested don't worg in second form

Edited by emcmoda
Link to comment
Share on other sites

I don't get any suggestion .

I run the sql querry , got the configuration options . The smartsuggest is enabled , i can see what keywords had been searched but on front page i don't get any suggestion .

I did all the steps from installation guide .

My osc version is 2.3.1 and my site is www.ecig-vapo.com

 

Any suggestion ?

 

If you add code in file advanted_search_results.php

 

Find this code:
 $listing_sql = $select_str . $from_str . $where_str . $order_str;

Directly AFTER add this:

 // MOD: BOF - SmartSuggest BEGIN
 if (SMARTSUGGEST_ENABLED == 'true' && SMARTSUGGEST_RECORD_KEYWORDS == 'true') {
   if (isset($_GET['keywords'])) {
if (!isset($_GET['page'])) $_GET['page'] = '1';
$searched_keywords_query = tep_db_query("select searched_keywords_id, pages
                                              from " . TABLE_SEARCHED_KEYWORDS . "
                                              where ip = '" . tep_db_input(tep_get_ip_address()) . "'
                                                and keywords = '" . tep_db_input($_GET['keywords']) . "'
                                                and date_added > '" . date('Y-m-d H:i:s', strtotime('-30 minutes')) . "'
                                              order by date_added desc");
     if ($searched_keywords = tep_db_fetch_array($searched_keywords_query)) {
       $pages = explode(',', $searched_keywords['pages']);
       if ($_GET['page'] != $pages[count($pages) - 1]) // only update if not the last visited page
         tep_db_perform('searched_keywords', array('pages' => $searched_keywords['pages'] . ',' . (int)$_GET['page']), 'update', "searched_keywords_id = '" . (int)$searched_keywords['searched_keywords_id'] . "'");
     } else {
       $input = array('keywords' => tep_db_prepare_input(tep_db_input($_GET['keywords'])),
                      'number_of_results' => (int)tep_db_num_rows(tep_db_query($listing_sql)),
                      'date_added' => date('Y-m-d H:i:s'),
                      'ip' => tep_get_ip_address(),
                      'pages' => (int)$_GET['page']);
       if ($customer_id) $input['customers_id'] = (int)$customer_id;
       if ($cart->count_contents() > 0) {
         $products = $cart->get_products();
         foreach ($products as $product)
           $products_ids[] = $product['id'];
         $input['products_ids'] = implode(',', $products_ids);
       }
       tep_db_perform(TABLE_SEARCHED_KEYWORDS, $input);
       tep_session_register('searched_keywords_id');
       $searched_keywords_id = tep_db_insert_id();
     }
   }
 }
 // MOD: EOF - SmartSuggest BEGIN

Link to comment
Share on other sites

@@emcmoda

 

I have added that code , I updated all files to v1.0.2 version ,but still the same problem , no suggestions when typing a word in search box .

 

I have looked in menu.php file and the only refference to search box is this

 

 

 


<?  echo tep_draw_form('search',tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false),'get') ?>
<input type=text name="keywords" class="keywords" value="<?php echo $search_input_text; ?>" onfocus="if (this.value =='<?php echo $search_input_text; ?>') this.value=''" onblur="if (this.value=='') this.value='<?php echo $search_input_text; ?>'">
<input type="submit" alt="" class="do-search" value="">

 

Is this the problem why I am not getting any suggestions ?

Link to comment
Share on other sites

  • 2 weeks later...

This looks like a great add on but for some reason it behaves differently on http: htpps: requests see

http://www.wedding-workshop.co.uk vs https://www.wedding-workshop.co.uk the http works correctly with the suggestions out of the page but for the https version it add's it ot the contents of the search box and you cannot tell what you are aboutto click on - can you help?

Link to comment
Share on other sites

  • 2 weeks later...

@@emcmoda

 

I have added that code , I updated all files to v1.0.2 version ,but still the same problem , no suggestions when typing a word in search box .

 

I have looked in menu.php file and the only refference to search box is this

 

 

 


<? echo tep_draw_form('search',tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false),'get') ?>
<input type=text name="keywords" class="keywords" value="<?php echo $search_input_text; ?>" onfocus="if (this.value =='<?php echo $search_input_text; ?>') this.value=''" onblur="if (this.value=='') this.value='<?php echo $search_input_text; ?>'">
<input type="submit" alt="" class="do-search" value="">

 

Is this the problem why I am not getting any suggestions ?

 

Can you try now - still i dont know how solved problem with polish character for example ąś ć mayby ascii ?

 

write in box search: szal

Link to comment
Share on other sites

Hi,

 

This add-on is the thing I was looking for such a long time - thanks a lot for sharing it.

Unfortunately I got some issues with it:

 

The database wasn't installed automaticly. I ran the SQL-file and this problem is fixed now. The searched keywords are saved in the database, the SmartSuggest configuration is set in admin, the admin/stats_keywords_searched.php shows the searched keywords - BUT there are no suggests in frontpage. This might be caused by my modified search-box, which is placed in the header (www.ratzfatz-kindermoden.de). Here is the code I'm using - could you please have a look at it and tell me, if there is something wrong or missing.

<tr><td><form name="quick_find" action="advanced_search_result.php" method="get" id="frmSearch">
<div style="background: #638cfe; padding: 10px 0 10px 10px;"><div style="float:left; margin-right: 6px;">
<input style="width: 135px; border: 1px solid #fff; color:#999;" type="text" name="keywords" id="txtSearch" onkeyup="searchSuggest(event);" autocomplete="off" maxlength="30" value="Ihr Suchbegriff..." onfocus="this.value=' '">
<input type="hidden" name="search_in_description" value="1">
<input type="hidden" name="inc_subcat" value="1">
<?php // MOD: BOF - SmartSuggest
if (SMARTSUGGEST_ENABLED != 'false') {
require(DIR_WS_CLASSES . 'smartsuggest.php');
$smartsuggest = new smartsuggest();
$smartsuggest->output();
}
// MOD: EOF - SmartSuggest
?>
</div>
<div><?php echo tep_image_submit('suchestart.gif', BOX_HEADING_SEARCH); ?></div></div></form></td></tr>

 

Thank you so much

Carla

 

osc 2.2 (heavily modified) , php 4.49, SmartSuggest 1.0.2

Link to comment
Share on other sites

Upps forgot the DIV for the suggest. The code is now

<td><form name="quick_find" action="advanced_search_result.php" method="get" id="frmSearch">   
<div><div style="float:left; padding: 3px 0;margin-right: 6px; line-height:1.5;">
<input style="width: 145px; padding:1px 2px 2px; height: 22px; font-size: 11px; vertical-align:middle;border: none; color:#999;" type="text" name="keywords" id="txtSearch" onkeyup="searchSuggest(event);" autocomplete="off" maxlength="30"  value="Ihr Suchbegriff..." onfocus="this.value=' '">
<input type="hidden" name="search_in_description" value="1">
<input type="hidden" name="inc_subcat" value="1">
<div id="smartsuggest" ></div>
<?php // MOD: BOF - SmartSuggest
if (SMARTSUGGEST_ENABLED != 'false') {
require(DIR_WS_CLASSES . 'smartsuggest.php');
$smartsuggest = new smartsuggest();
$smartsuggest->output();
}
// MOD: EOF - SmartSuggest
?>
</div>
<div style="padding: 3px 0;"><?php echo tep_image_submit('suchestart_small.gif', BOX_HEADING_SEARCH); ?></div></div></form></td>

But does not work neither.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...