VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: VB74 on September 14, 2022, 14:23:03 PM

Title: Problem with Ajax Live Search for Virtuemart module
Post by: VB74 on September 14, 2022, 14:23:03 PM
Hello,

I have a problem with Ajax Live Search for Virtuemart module (https://www.jeyamtemplates.com/joomla-modules/virtuemart-ajax-live-search.html).

I bought the extension Ajax Live Search for Virtuemart (1.0.6) few months ago, but it doesn't work on our website.
As you can see on the picture just below, when I write a product number in the search area, the ajax loader stay like that and there is no proposition of result.

(https://www.zupimages.net/up/22/37/16fo.jpg)

I work with Joomla 3.10.10 and Virtuemart 4.0.6 (I had VM 3 few days ago and the extension didn't work too).

Thank you in advance for your help

Valentin
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: pinochico on September 14, 2022, 14:58:25 PM
no help,

ask developper - Jeyam Team - https://www.jeyamtemplates.com
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: Studio 42 on September 14, 2022, 21:01:12 PM
Look in your browser console, if the module send back some ajax results
Perhpas you have PHP debug activated and you have mix of debug message and json result and this break the script
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: VB74 on September 26, 2022, 11:31:18 AM
Thank you for your answer, I checked my browser console :

(https://zupimages.net/up/22/39/tulh.png)
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: GJC Web Design on September 26, 2022, 15:59:51 PM
you've got mixed https and http calls ... make sure the ajax search is using https
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: Jumbo! on September 27, 2022, 08:10:01 AM
It is a cross-origin Ajax call issue of your site.

The search function will not work from this URL - https://senga.fr (https://senga.fr/). But if you try from this URL - https://www.senga.fr (https://www.senga.fr/) it will work fine.

It is a basic "www" and "non-www" prefix resolving issues.

Your domain name should never resolve both with "non-www" and "www". That means the site should be made accessible either using www.your-site.com or your-site.com.

It would help if you ensured that non-www requests are redirected to www. Which will also improve your search engine/crawler performance. Refer to this StackOverflow post for more details: https://stackoverflow.com/questions/12050590/redirect-non-www-to-www-in-htaccess. It will also resolve your problem. You need to add the following redirect rules to your .htaccess file.

# Redirect to www
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: VB74 on September 28, 2022, 10:59:46 AM
Thank you for your answers.

@GJC Web Design: Unless I am mistaken, I do not see any http calls. It's only https.

@Jumbo: I managed to make the www redirection on my website. That's a good point, but the Ajax Search module still doesn't work. I still have the Ajax loader running forever, without giving me any suggestions of results.

PS: For the moment I use an alternative module "Virtuemart Search Autocomplete" on my website. In this way, my customers can do research, but this is not the module I prefer.
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: GJC Web Design on September 28, 2022, 13:32:35 PM
Quote@GJC Web Design: Unless I am mistaken, I do not see any http calls. It's only https.

my mistake .. wrong glasses ..  ;D

is this not the problem->  VM593:1 ERR SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: Studio 42 on September 29, 2022, 10:37:59 AM
Your problem is that you send a JSON request but display HTML.
option: com_ajax
module: jp_vm_ajax_search
format: json
method: searchdata
jpsearchword: test
moduleid: 232
language_tag: fr-FR

format: json mean send back JSON in Joomla
Perhaps you should use a module that respect the basic rules
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: Milbo on October 02, 2022, 23:52:48 PM
Quote from: Jumbo! on September 27, 2022, 08:10:01 AM
Your domain name should never resolve both with "non-www" and "www". That means the site should be made accessible either using www.your-site.com or your-site.com.

I see that different. It should work. Good code can that. I know, your code can that and standard vm code, too.

Yep, Patrick. JS dont like mixing variable types.
Title: Re: Problem with Ajax Live Search for Virtuemart module
Post by: ivane on January 09, 2024, 03:56:23 AM
I hope this message finds you well. I wanted to share my experience in resolving a similar issue with the "Ajax Live Search for Virtuemart" module, and I believe this solution might be helpful for you.

Upon encountering the issue, I contacted the support team, and they promptly addressed it by adding the site URL to the configuration.php file. This simple adjustment proved to be effective in resolving the problem.