Instant Search

Views: 59,248

Results 181 to 200 of 262
6 Jun 2023, 5:29 PM
#181
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Instant Search

dbltoe:

I'm sure there is a way to add that and looking at https://www.cloudways.com/blog/live-search-php-mysql-ajax/ might give some pointers BUT,

I'm not sure you could successfully present enough space to show enough of the product description to make it worthwhile.

Even using more... to truncate the presented info, you would still need 100-150 characters to show to even start making sense of what might be in the description. Google truncates its search results at 160 characters.

Whereever you decide to truncate for the search, you would need to make sure the characters shown are not just filler but contain enough information to "tease" the customer.
I would rather have the product description in the dropdown than the item code which is less useful to the customer, at least in the search

29 Jun 2023, 11:31 AM
#182
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: Instant Search

Experiencing an issue only on Safari browsers (iOS and Mac) where the dropdown seems to close too early on clicking a product link. You click on a result in the dropdown menu but you aren't routed to the link you clicked on, you remain on the same page. I was able to track it down to this block of code:

function handleBlur(event: React.FocusEvent<HTMLInputElement>) {
    // If focus is moved to the results container, do not hide the results
    if (event.relatedTarget && event.relatedTarget instanceof HTMLElement && event.relatedTarget.classList.contains('instantSearchResultsDropdownContainer__link')) {
        return;
    }

    setShowResults(false);
}

She made a small change to the equivalent vanilla JavaScript file (instant_search_dropdown) which wraps this function's logic in a small setTimeout of 300ms, and the addition of this short delay resolves the issue for me. It is a hacky workaround though, so I am posting in the hopes that there is a better solution:

                    e.createElement(
                        e.StrictMode,
                        null,
                        e.createElement(
                            W,
                            { client: p },
                            e.createElement("input", {
                                type: "text",
                                value: i,
                                onChange: (e) => o(e.currentTarget.value),
                                onFocus: () => _(),
                                onBlur: function (e) {

// NM - This setTimeout wrapper is a hacky workaround. Replace this file when the plugin is updated with a fix --
// dropdown closes in Safari without routing to the product page.
setTimeout(() => {
(e.relatedTarget && e.relatedTarget instanceof HTMLElement && e.relatedTarget.classList.contains("instantSearchResultsDropdownContainer__link")) || s(!1);
}, 300);
},

"aria-expanded": u && c,
autoComplete: "off",
role: "combobox",
"aria-autocomplete": "list",
"aria-owns": u ? #${pe}-${n} : "",
ref: d,
}),
u && e.createElement(he, { queryTextParsed: l, containerIndex: n, setIsResultsContainerExpanded: f })
)
)
);
},

Once again, great plugin, thanks!!!

30 Jun 2023, 5:30 PM
#183
marcopm avatar

marcopm

New Zenner

Join Date:
Jun 2021
Posts:
42
Plugin Contributions:
1

Re: Instant Search

allmart:

Experiencing an issue only on Safari browsers (iOS and Mac) where the dropdown seems to close too early on clicking a product link. You click on a result in the dropdown menu but you aren't routed to the link you clicked on, you remain on the same page. I was able to track it down to this block of code:

Huge thanks for noticing this bug, pretty serious by the way, unfortunately I don't have access to an Apple device so I couldn't test it properly (shame on me).
I can run a webkit browser on my development environment, but for some reason this js script isn't working properly (seems to have something to do with react-query but I don't have enough patience/time to go through it properly now).
Also because of this, it took me a while to find the cause of the problem, which is partly explained here https://stackoverflow.com/a/70870755

The timeout workaround is actually a pretty good idea (it's also suggested among the answers on that stackoverflow thread).
I managed to find another viable solution (I hope): https://github.com/marco-pm/zencart_instantsearch/issues/23
You can try download the new instant_search_dropdown.min.js file from github and see if it works.

26 Jul 2023, 11:11 AM
#184
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: Instant Search

Sorry for the late reply, your fix works on Apple devices. Thanks!

11 Aug 2023, 3:04 PM
#185
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Instant Search

It installed easily but it's not working. No error messages - just nothing. ZC 1.5.7d php 7.4. What could I be missing? I am making the assumption that all files are uploaded and the plugin manager is checking for that issue.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

11 Aug 2023, 5:04 PM
#186
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,867
Plugin Contributions:
19

Re: Instant Search

Have you tried the newest version (4.02) on GitHub? Also, if you are using boootstrap, turn on the search there.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

12 Aug 2023, 12:54 AM
#187
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Instant Search

dbltoe:

You don't state what template you are using. Bootstrap includes a great search feature but, you have to turn it on.

This one says it has some options so you might want to look through the files for possible switches.

Not using bootstrap. It’s my own template. There are a lot of options but not one to enable the mod itself. But then again my brain got fried earlier today so hoping I just overlooked a minor detail.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

12 Aug 2023, 1:20 AM
#188
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: Instant Search

delia:

It installed easily but it's not working. No error messages - just nothing. ZC 1.5.7d php 7.4. What could I be missing? I am making the assumption that all files are uploaded and the plugin manager is checking for that issue.

when you say no error messages, what do you mean?

i would say to open the developer tools and see if there is a javascript error listed in the console.

assuming that you properly uploaded all of the files, my guess is that you are having some sort of javascript issue and the console in the dev tools would indicate if that is the case.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

14 Aug 2023, 9:51 AM
#189
marcopm avatar

marcopm

New Zenner

Join Date:
Jun 2021
Posts:
42
Plugin Contributions:
1

Re: Instant Search

delia:

I am making the assumption that all files are uploaded and the plugin manager is checking for that issue.

It does not, you must manually double-check that all the files have been uploaded correctly

delia:

Not using bootstrap. It’s my own template. There are a lot of options but not one to enable the mod itself. But then again my brain got fried earlier today so hoping I just overlooked a minor detail.

If you're using your own template, check out the "Autocomplete dropdown list doesn't appear" FAQ in the readme file. In short, you may need to specify your own custom CSS selector in settings.
Also, as carlwhat said, check if there are any JS errors in the developer console.

14 Aug 2023, 4:20 PM
#190
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Instant Search

Thanks Marco, I'm sure that's the issue. Forgive me but "keyword" denotes CSS class or div? Or something else? Nothing I've tried has made a difference. I did check on the upload - all good.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

16 Aug 2023, 7:35 AM
#191
marcopm avatar

marcopm

New Zenner

Join Date:
Jun 2021
Posts:
42
Plugin Contributions:
1

Re: Instant Search

delia:

Thanks Marco, I'm sure that's the issue. Forgive me but "keyword" denotes CSS class or div? Or something else? Nothing I've tried has made a difference. I did check on the upload - all good.

If you're not sure how to do it, google "how to find css selector". Maybe post the selector here as well so we can check if it at least makes sense (but it depends on your template).

Also, again: are there errors in the developer console? And/or in the /logs directory?

16 Aug 2023, 4:22 PM
#193
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,867
Plugin Contributions:
19

Re: Instant Search

Good info. Another helpful item for me is to right-click on the item or area I want to modify and select inspect.

Whether you do that in Chrome or Firefox, it will bring up the elements on the left and Styles on the right.

Once you find the element you are wanting to modify, it might not have a style associated with it. If so, at the top of the styles list is a + sign. Clicking on that will create a new style and use the selector you need to use in your personalized stylesheet. You can add settings while in the inspect mode and then copy the finished selector to your custom stylesheet.

One additional step is for those selectors that you only want to modify in a particular spot. (remember they are often all-inclusive while classes and divs are not) Say, the p tags in the define_main_page and not the rest of the home page. In the elements side, look to see if that p tag has a class or ID. If not, start up the list of Elements untill you find a class or ID. You then add that to the p tag so that the browser knows to add that styling to only the p tags in the define_main_page. In a stock 1.5.8 Zen Cart using the responsive_classic template, the resultant selector to turn all the p tags in the define_main_page to red would be:

#indexDefaultMainContent p {
color: red;
{
}
```The benefits are that, doing this while in the inspect mode, you can see if it is going to work before you add it to your custom stylesheet and the inspect mode will assist you in getting the proper syntax.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

17 Aug 2023, 3:23 PM
#194
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Instant Search

Excuse me but I'm well versed in CSS - in fact that used to be my speciality - graphics to CSS

The configuration setting says
CSS selector of the search input box(es). You might need to change it if you're using a custom template and the results dropdown is not showing.

Default: input[name="keyword"]

So where is the CSS? The default lists keyword for name - which my site has. That's not CSS. Do I change the name/keyword to class/whatever or div/whatever?

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

17 Aug 2023, 7:02 PM
#195
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,867
Plugin Contributions:
19

Re: Instant Search

delia:

Excuse me but I'm well versed in CSS - in fact that used to be my speciality - graphics to CSS

I would never cast dispersions upon or denigrate a guru.

I do like to take an opportunity to add helpful tips for those who lurk and stumble across this post later.

As to the keyword, you may need to find something like the datepicker in specials that sets the expiration date on line ~634.

$('[B]input[name="[/B]expires_date"]').datepicker({

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

18 Aug 2023, 3:26 PM
#196
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Instant Search

To regroup here :

the dropdown is not showing.

In the instructions:
Dropdown - Input Box Selector : CSS selector of the search input box(es). You might need to change it if you're using a custom template and the results dropdown is not showing.

Default: input[name="keyword"]

So the default input listed as name / keyword WHICH IS NOT A CSS SELECTOR and is also present in my template.

The instant search css has css starting with instantSearchInputWrapper

The template does have a file for the ajax instant search dropdown that matches the CSS.

So I am having difficulty seeing that CSS actually is the problem. Yes, I'm using my own template based on the original sidebox files with no core changes and some additional CSS but mostly default zencart template. I have no added jquery in the site. I see no conflict or issues using the browser console.

I also just installed it on a default 15.8 cart with the responsive template and it doesn't work on it either.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

18 Aug 2023, 4:22 PM
#197
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Instant Search

delia:

To regroup here :

the dropdown is not showing.

In the instructions:
Dropdown - Input Box Selector : CSS selector of the search input box(es). You might need to change it if you're using a custom template and the results dropdown is not showing.

Default: input[name="keyword"]

So the default input listed as name / keyword WHICH IS NOT A CSS SELECTOR and is also present in my template.

The instant search css has css starting with instantSearchInputWrapper

The template does have a file for the ajax instant search dropdown that matches the CSS.

So I am having difficulty seeing that CSS actually is the problem. Yes, I'm using my own template based on the original sidebox files with no core changes and some additional CSS but mostly default zencart template. I have no added jquery in the site. I see no conflict or issues using the browser console.

I also just installed it on a default 15.8 cart with the responsive template and it doesn't work on it either.
er, the** input[name="keyword"]** *is *a valid CSS selector; see this (https://www.w3schools.com/cssref/sel_attribute_value.php) link.

19 Aug 2023, 2:10 PM
#198
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Instant Search

lat9:

er, the** input[name="keyword"]** *is *a valid CSS selector; see this (https://www.w3schools.com/cssref/sel_attribute_value.php) link.

So why does it not work? I know how to troubleshoot CSS problems but there's nothing showing for me to look at.

AND if it doesn't work "out of the box" or for the responsive template and stumps an experienced person, I'm not sure I see the value here. I'm not accustomed to giving up but ....

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

20 Aug 2023, 3:52 PM
#199
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Instant Search

delia:

So why does it not work? I know how to troubleshoot CSS problems but there's nothing showing for me to look at.

AND if it doesn't work "out of the box" or for the responsive template and stumps an experienced person, I'm not sure I see the value here. I'm not accustomed to giving up but ....
Do you have a customized template? The Instant Search plugin's jQuery/javascript is looking for changes to, by default, an input field named 'keyword' in order to send changes from that keyword-entry back to the site to gather matching products.

FWIW, the default responsive_classic uses the template_default/sideboxes/tpl_search.php and tpl_search_header.php to render the search-related sideboxes'. In both cases, an input field named 'keyword' is created to accept the customer's search keywords.

20 Aug 2023, 4:04 PM
#200
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Instant Search

lat9:

Do you have a customized template? The Instant Search plugin's jQuery/javascript is looking for changes to, by default, an input field named 'keyword' in order to send changes from that keyword-entry back to the site to gather matching products.

FWIW, the default responsive_classic uses the template_default/sideboxes/tpl_search.php and tpl_search_header.php to render the search-related sideboxes'. In both cases, an input field named 'keyword' is created to accept the customer's search keywords.

Keyword is created.... how and where? Are you saying the mod does that or that is what is needed to be done? In the instructions it mentions keyword only as a name - not input but attribute of input. So you are saying there needs to be an actual input field (assumedly then hidden from view) that is called name?

No, no error logs or console errors.

People, no one has offered any sample - any code, any site. I don't maintain or create mods anymore but instructions are important. There are no instructions, just that one thing in the configuration.

I was interested when looking at github that there was a suggestion this mod be added into the template. I'm all for that - if only to ge the dang code etc.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo