News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Problem with Ajax Live Search for Virtuemart module

Started by VB74, September 14, 2022, 14:23:03 PM

Previous topic - Next topic

VB74

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.



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

pinochico

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Studio 42

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

VB74

Thank you for your answer, I checked my browser console :


GJC Web Design

you've got mixed https and http calls ... make sure the ajax search is using https
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Jumbo!

It is a cross-origin Ajax call issue of your site.

The search function will not work from this URL - https://senga.fr. But if you try from this URL - 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]

VB74

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.

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

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

Milbo

#9
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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ivane

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.