Jump to content
auzStar

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

Recommended Posts

13 hours ago, ce7 said:

Then tried to replace catalog/ext/ with V1.7, it works.

Can you clarify what that means?  There are a lot of folders/files under that filepath you referenced.

You began with version 1.8.....yes?

- Andrea

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites
On 2/4/2020 at 4:50 AM, puggybelle said:

Can you clarify what that means?  There are a lot of folders/files under that filepath you referenced.

You began with version 1.8.....yes?

- Andrea

Yes, at first I download the v1.8 from 13th October 2016, after few trials, did not modify any code, just replace the catalog/ext/ folder with v1.7  13th September 2016, it then show up the results for me instead of "no matches". The only issue for me is that can not filter less then 3 letters....with BS version, if i typed 2 letters, it filter out the result...

image.thumb.png.a55566ec7346893c471474bdfb24dd48.png

Edited by ce7

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Hi Andrea,

I just sent you a PM with my EDGE site (pre Frozen) where this addon works.

regards

Valqui


Please do not falsify my words. Are you interested in knowing who does it? Send me a PM.

The Phoenix Club won't allow me to join - why not?

Setting up a new Frozen site with so many nice addons available on the market. 

:heart: Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

Anyone know that of the life of auzStar @auzStar?

This person is responsible for large and nice oscommerce addon and we  miss him  !!
We need more talented people like him to advance the project !!


Please do not falsify my words. Are you interested in knowing who does it? Send me a PM.

The Phoenix Club won't allow me to join - why not?

Setting up a new Frozen site with so many nice addons available on the market. 

:heart: Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

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

 

 

 

Share this post


Link to post
Share on other sites

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

Does the addon call on its own class file ?


Help shape the future of Phoenix; join the Phoenix Club

Share this post


Link to post
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.

Share this post


Link to post
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.

 

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

@ecartz  Matt - Just for my understanding (and mabe others)  - Do you mean to change shopside        /includes/confugure.php

define('DIR_FS_CATALOG', dirname($_SERVER['SCRIPT_FILENAME']) . '/');

to an absolute path?

Share this post


Link to post
Share on other sites
1 minute ago, azpro said:

@ecartz  Matt - Just for my understanding (and mabe others)  - Do you mean to change shopside        /includes/confugure.php


define('DIR_FS_CATALOG', dirname($_SERVER['SCRIPT_FILENAME']) . '/');

to an absolute path?

Yes. 


Always back up before making changes.

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

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

×