advanced search by type ahead

Open to all! Ask other shopowners for help.
User avatar
mhsuffolk
Contributor
Posts: 199
Joined: Sat Oct 26, 2019 9:13 am
Phoenix Version: v1.1.0.6
Has thanked: 12 times
Been thanked: 11 times

Re: advanced search by type ahead

Post by mhsuffolk »

zipurman wrote: Sun Feb 12, 2023 6:22 am
ecartz wrote: Sat Feb 11, 2023 9:58 pm If you're properly passing the session ID ...
Dumb question ... but what is the "proper" way to pass the session id? If you navigate between pages in Phoenix it doesn't register multiple entries into the whois database, and the session ID is not part of those urls? Also, I cannot replicate this, so not sure what session setup needs to be in place to have this issue occur? @mhsuffolk what version of Phoenix are you using?
Ah, this is interesting. My live shop is 1.0.8.4 which I have upgraded from 1.0.7.0. I have a clean install test shop on 1.0.8.15 and this does not do this.
zipurman wrote: Sun Feb 12, 2023 6:22 am
ecartz wrote: Sat Feb 11, 2023 9:58 pm If you're properly passing the session ID ...
If you navigate between pages in Phoenix it doesn't register multiple entries into the whois database, and the session ID is not part of those urls?
My 1.0.8.4 live shop produces a new row for very page that the user navigates. Was this old behaviour and my updates have missed the change? This may be why I see this issue.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
mhsuffolk
Contributor
Posts: 199
Joined: Sat Oct 26, 2019 9:13 am
Phoenix Version: v1.1.0.6
Has thanked: 12 times
Been thanked: 11 times

Re: advanced search by type ahead

Post by mhsuffolk »

Point of Interest.
One good side effect of having a entry/line for every click is that hacking attempts can be identified very easily. On my live shop I sometimes get many repeated clicks a few seconds apart from one IP on privacy.php and shipping.php and others. These IPs can then be blocked.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: advanced search by type ahead

Post by ecartz »

If you use Href, then it will pass the session ID for you. If you use a GET form with Form->hide_session_id, it will pass the session ID for you. If the client's browser allows the session cookie, it will pass the session ID for you.

If you're building a link in Javascript, you have to duplicate those behaviors. So check if the cookie exists. If so, you're done. If not, either add it to the query string (for GET requests) or add it to the request body (for POST, PUT, etc.).

To replicate, I would start by using a browser with cookies turned off. This should force the session ID into the URL. Note: a Chrome profile would count as a separate browser in this case.
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

Thanks @ecartz and @mhsuffolk

I was able to recreate the issue and coded in a fix :)

I will add a new option to allow admins to choose which behaviour they want.
I will also be adding a setting for number of minimum characters before an ajax call is made.
zipurman
-----------
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

New version released:
  • Removed bottom margin from results windows on wider inputs. Kept margin for narrow result windows as items stack differently.
  • Reworked styles for narrow search boxes.
  • Added setting to pass session id if cookie is not set. Default is true.
  • Added setting to require minimum characters before search calls for results. Default is 1.
zipurman
-----------
User avatar
Pierre_P
Contributor
Posts: 144
Joined: Fri Mar 12, 2021 5:06 am
Phoenix Version: v1.1.0.6
Has thanked: 21 times
Been thanked: 11 times

Re: advanced search by type ahead

Post by Pierre_P »

Just one question here
I'm using @raiwa KissIT image thumbnailer with watermark.
The search is directly calling the images with scr=
Is there another way to call the images where KissIt will still function?
User avatar
zipurman
Builder
Posts: 540
Joined: Tue Oct 13, 2020 5:20 pm
Phoenix Version: v
Has thanked: 93 times
Been thanked: 162 times

Re: advanced search by type ahead

Post by zipurman »

Pierre_P wrote: Tue Feb 21, 2023 6:48 pm I'm using @raiwa KissIT image thumbnailer with watermark.
KissIT Support Added
zipurman
-----------
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: advanced search by type ahead

Post by BatteryTrader »

I have installed this (1.7.2) on 1.1.0.2, from the add ons, all seemed to go ok, its in admin config, with options etc.

But when I go to catalog to do a search it does not seem to be doing anything.

There is only the fruit in the new install of 1.1.0.1, but would have thought there was something for it to search

No PHP errors logged, is it likely to work on 1.1.0.2, or does it need updating first?

Regards

David
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: advanced search by type ahead

Post by burt »

The addon probably requires jQuery, which no longer exists in 1.1.0.2

If the addon needs jQuery, the addon needs to be updated.
I am not here to build for you.
I am here to build with you. Let's help each other.
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: advanced search by type ahead

Post by BatteryTrader »

If anyone can update this addon to 1.1.0.2, I assume it needs the jquery replaced then please message me as I am interested.

Thank you

David


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply