Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Twitter Typeahead Autocomplete Search for osC 2.3.4 (BS and nonBS)


auzStar

Recommended Posts

@ce7

Well, I just took what you said literally and swapped out the catalog/ext/ files in 1.8 with 1.7 and no change for me.

It's still not working on the first page load.  Would love to have a link to a site that does have it working.

- Andrea

Link to comment
Share on other sites

@ce7

Yes, but...the issue we're all complaining about is that it does not work on the first page load. 

We're getting 'no matches' when first loading the website.  Only if we click on something...anything at all...and then try to use search will it work.

Please PM me with a link to your site.  I want to see if it works on my first try after loading your homepage.

As for the filter issue you're having...have you assigned the correct number in the module?

twit.JPG.7d0cc4793e4261650b71bead93c7b2b5.JPG

Link to comment
Share on other sites

  • 2 weeks later...

I was able to get this addon to work with Phoenix until the version 1.0.5.0 (really, somewhere between versions 1.0.4.0 and 1.0.5.0).

I believe it has something to do with the the recent autoloader.php (includes/functions/autoloader.php) addition. To quickly summarize, it appears the autoloader.php file is looking for directories that shouldn't exist.

Here is one of the main directory paths for this addon: 'catalog/ext/modules/header_tags/twitter_typeahead

However, it appears the autoloader is looking for 'catalog/ext/modules/header_tags/twitter_typeahead/includes/hooks'. 

 

@burt I just want to pick your brain on the following errors. Is there something different/new we need to do with directory paths? I'm afraid I'm not sure why the autoloader is involved here.

Directory 'ext/modules/header_tags/twitter_typeahead/includes/hooks/includes/hooks' doesn't exist
[20-Feb-2020 10:00:57 America/Chicago] PHP Warning:  scandir(C:/localhost/www/phoenix/catalog/ext/modules/header_tags/twitter_typeahead/includes/hooks,C:/localhost/www/phoenix/catalog/ext/modules/header_tags/twitter_typeahead/includes/hooks): The system cannot find the path specified. (code: 3) in C:\localhost\www\phoenix\catalog\includes\functions\autoloader.php on line 46
[20-Feb-2020 10:00:57 America/Chicago] PHP Warning:  scandir(): (errno 2): No such file or directory in C:\localhost\www\phoenix\catalog\includes\functions\autoloader.php on line 46
[20-Feb-2020 10:00:57 America/Chicago] PHP Warning:  Invalid argument supplied for foreach() in C:\localhost\www\phoenix\catalog\includes\functions\autoloader.php on line 46


Directory 'ext/modules/header_tags/twitter_typeahead/includes/modules' doesn't exist
[20-Feb-2020 10:00:57 America/Chicago] PHP Warning:  scandir(C:/localhost/www/phoenix/catalog/ext/modules/header_tags/twitter_typeahead/includes/modules,C:/localhost/www/phoenix/catalog/ext/modules/header_tags/twitter_typeahead/includes/modules): The system cannot find the path specified. (code: 3) in C:\localhost\www\phoenix\catalog\includes\functions\autoloader.php on line 14


Directory 'ext/modules/header_tags/twitter_typeahead/includes/classes' doesn't exist
[20-Feb-2020 10:00:57 America/Chicago] PHP Warning:  scandir(C:/localhost/www/phoenix/catalog/ext/modules/header_tags/twitter_typeahead/includes/classes,C:/localhost/www/phoenix/catalog/ext/modules/header_tags/twitter_typeahead/includes/classes): The system cannot find the path specified. (code: 3) in C:\localhost\www\phoenix\catalog\includes\functions\autoloader.php on line 14


Directory 'ext/modules/header_tags/twitter_typeahead/includes/system/versioned' doesn't exist
[20-Feb-2020 10:00:57 America/Chicago] PHP Warning:  scandir(C:/localhost/www/phoenix/catalog/ext/modules/header_tags/twitter_typeahead/includes/system/versioned,C:/localhost/www/phoenix/catalog/ext/modules/header_tags/twitter_typeahead/includes/system/versioned): The system cannot find the path specified. (code: 3) in C:\localhost\www\phoenix\catalog\includes\functions\autoloader.php on line 14

 

 

 

Link to comment
Share on other sites

16 minutes ago, SuperPower09 said:

Is there something different/new we need to do with directory paths? I'm afraid I'm not sure why the autoloader is involved here.

It looks like the App sets DIR_FS_CATALOG to its own value.  Then the autoloader attempts to use it but of course can't find stuff there. 

My suggestion would be to look at how the App uses DIR_FS_CATALOG and change it to work with DIR_FS_CATALOG . 'ext/modules/header_tags/twitter_typeahead/' instead. 

Alternately, you could make a duplicate version of includes/application_top.php that doesn't call the autoloader.  But it seems simpler to adjust the App than to duplicate other files. 

Always back up before making changes.

Link to comment
Share on other sites

17 minutes ago, burt said:

Never used this addon, so cannot comment in any meaningful way.

Does the addon call on its own class file ?

No, it doesn't but I appreciate your response, I know you're very busy.

1 minute ago, ecartz said:

It looks like the App sets DIR_FS_CATALOG to its own value.  Then the autoloader attempts to use it but of course can't find stuff there. 

My suggestion would be to look at how the App uses DIR_FS_CATALOG and change it to work with DIR_FS_CATALOG . 'ext/modules/header_tags/twitter_typeahead/' instead. 

Alternately, you could make a duplicate version of includes/application_top.php that doesn't call the autoloader.  But it seems simpler to adjust the App than to duplicate other files. 

And thank you, I will start here and see what I can figure out.

 

Link to comment
Share on other sites

@ecartz I was able to figure it out and it was quite simple. I'll post it so that it may help others.

So, there are two files - autocomplete.php and product_info_tt.php

These two files are deep in the 'ext' directory. Towards the beginning of these two files, there is the following code:

chdir('../../../../');
require 'includes/application_top.php';

So, I moved the two files to the main directory (in my case, "catalog/") and removed the "chdir('../../../../')" function. I had to update the URLs within the "ht-twitter-typeahead.js.php file to point to new directory path of the two files. After that, the addon worked as normal.

For those who cannot get this addon to work, in my case, I updated my code by using CoreJS-Typeahead (https://github.com/corejavascript/typeahead.js), which is the successor to Twitter Typeahead but it is pretty much set up the same. If I have time, I'll post what I've done but it's really all a matter of comparing the current osCommerce addon with CoreJavascript and making those changes.

 

Link to comment
Share on other sites

18 hours ago, SuperPower09 said:

So, I moved the two files to the main directory (in my case, "catalog/") and removed the "chdir('../../../../')" function. I had to update the URLs within the "ht-twitter-typeahead.js.php file to point to new directory path of the two files. After that, the addon worked as normal.

I still think that a better solution to this would be to fix the DIR_FS_CATALOG value in includes/configure.php to not change with the location of the calling page.  Then you can leave the files inside ext. 

Always back up before making changes.

Link to comment
Share on other sites

For anyone asking themselves what it shoud/could be FOR EXAMPLE:

define('DIR_FS_CATALOG', '/data/www/my_website/public_html/'); 

This is Shopside!

So you should check your absolute path and correct for your shop - becaue this can differ for specific servers.

I hope this helps!

Link to comment
Share on other sites

3 hours ago, azpro said:

For anyone asking themselves what it shoud/could be FOR EXAMPLE:


define('DIR_FS_CATALOG', '/data/www/my_website/public_html/'); 

This is Shopside!

So you should check your absolute path and correct for your shop - becaue this can differ for specific servers.

I hope this helps!

The error will tell you what it should be.  For example if that is the correct value, then the error will tell you that it is using /data/www/my_website/public_html/ext/modules/header_tags/twitter_typeahead/includes/hooks

When you see the ext/modules/ part, you know that the part that you want is to the left of it.  It should end with a /

Always back up before making changes.

Link to comment
Share on other sites

6 hours ago, ecartz said:

I still think that a better solution to this would be to fix the DIR_FS_CATALOG value in includes/configure.php to not change with the location of the calling page.  Then you can leave the files inside ext. 

5 hours ago, azpro said:

For anyone asking themselves what it shoud/could be FOR EXAMPLE:


define('DIR_FS_CATALOG', '/data/www/my_website/public_html/'); 

This is Shopside!

So you should check your absolute path and correct for your shop - becaue this can differ for specific servers.

I hope this helps!

 

Boom! This completely solves it and makes it sustainable for any future upgrades.

Thank you both for your time and details here.

Link to comment
Share on other sites

41 minutes ago, SuperPower09 said:

 

Boom! This completely solves it and makes it sustainable for any future upgrades.

Thank you both for your time and details here.

DeDe does this solve the problem of it not working on an initial page load?  See the following post.

Dan

Link to comment
Share on other sites

  • 1 year later...

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