0

search bar on skorpion.info.pl doesn't return anything - it sends you to a page "skorpion.info.pl/undefined". I tried working on that, but couldn't fix it in any way. The search is run by Advanced Custom Fields and ACF: Better Search. It somehow worked ONE TIME, but doesn't anymore.

Can you please take a look? What is wrong with it? What could make it work?

Best regards

EDIT - I somehow managed to do a single positive search try yet again. It was done by inputting only "BE" letters and then searching. The search results URL looks like that: http://skorpion.info.pl/wyszukiwanie/?phrase=bemar And the URL upon trying to search anything looks like that: http://skorpion.info.pl/undefined

EDIT 2 - I found out one of the IDs was searcPhrase instead of searchPhrase - changing it resolved half of the problem - now searching returns this URL: http://skorpion.info.pl/wyszukiwanie/?phrase= The problem is, it is always blank, I mean, after "phrase=", hence it shows all of the products on site.

2
  • Does it work without those plugins? 3rd party plugin support is off topic here, and it looks like you're using the ACF Better search functionality to power your search. Also your input has no form tag, so it isn't a valid form, and your search button isn't a button it's a hyperlink, so your searches are completely unrelated to whatever is in that box
    – Tom J Nowell
    Commented Nov 12, 2020 at 17:15
  • Hi Tom, no - it doesn't work whether the plugin is turned on or not.
    – Pete
    Commented Nov 12, 2020 at 17:17

1 Answer 1

0

Might not be the real cause, but you have a JS error due to badly formatted JS - the following lines:

<script type="text/javascript">
jQuery(document).ready(function( $ ){
jQuery(“a[href=’#aiwoosearch#’]”).attr(‘onclick’, ‘parentNode.submit();’);
jQuery(“a[href=’#aiwoosearch#’]”).attr(“href”, “javascript:;”);
});
</script>

Those quote marks are wrong & try " & ' instead and test again with your JS console open in inspector.

8
  • Thank you, it's just a custom code I used to try and make alternative search work - and it does (after the changes you suggested), but it's really a last-resort-type of thing. Using WooCommerce Menu Extension plugin and this code above (that #aiwoosearch# thing made it impossible to use that additional search bar as it was turned into broken link) gives an option to find products, but it's not looking anything like I would like it to.
    – Pete
    Commented Nov 12, 2020 at 16:13
  • you might need to add custom CSS to make it look as you want, the visual aspect of the thing can be customised. you should be careful when copying and pasting code from some sites the " " have the wrong formatting. Commented Nov 12, 2020 at 16:36
  • Yes I know custom CSS can help figuring it out, but using that alternative search source disables the live-search function that is actually working, somehow. Maybe it's possible to add some kind of JQuery code to change href of the search icon to skorpion.info.pl/wyszukiwanie/?phrase=XYZ, where XYZ would be what user typed in the search bar?
    – Pete
    Commented Nov 12, 2020 at 16:53
  • @Pete - perhaps you should remove your temporary work arounds if you want people to help you fix the original functionality - focus on that first, if that fails, work on the work around...
    – Q Studio
    Commented Nov 12, 2020 at 17:24
  • @QStudio I'm sorry - the temporary code is disabld. Also, please look up my EDIT 2 to original post. Maybe you can see the solution now, that it's halfway there?
    – Pete
    Commented Nov 12, 2020 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.