Page 1 of 1

Virtuemart Ajax Search - modify search results

PostPosted: Mon Jun 10, 2013 3:41 pm
by mo@.....dk
Hi,

I need to change the search mechanism in a specific way.

As it is now I have this problem:

Let´s say I want to search for a product named "Canon Pixma IP2000"
If I search with these search words "canon pixma" or "pixma IP2000" it works great and the product is found.
But if I use these search words "pixma canon" or "canon IP2000" the product is not found.

Does anyone know how to fix this and which file I need to edit?

Re: Virtuemart Ajax Search - modify search results

PostPosted: Mon Jul 22, 2013 4:13 pm
by atrus80
This problem is true indeed Stan, i agee with the user. We should be able to search for terms in any position within the name of the product, not only in the specific order of the search.

Would love to see a fix for this.

Rgrds,
Chris

Re: Virtuemart Ajax Search - modify search results

PostPosted: Mon Jul 22, 2013 5:25 pm
by mo@.....dk
Hi again,

I had a developer help me modify the file: /modules/mod_vm_ajax_search/ajax/index.php so that the search now works better than anything I have seen before.

A few examples:

I have a product names "Canon Pixma IP2000"

If I type in this search: "can ip2" it finds the product or category.
If I type in "ip20 cano" it also finds the product or category.

Try out the search in the top of the page on my clients site:
http://www.printmore.dk/

I have attached the index.php file as a zip-file, just in case you want to use the alterations I have made.

Re: Virtuemart Ajax Search - modify search results

PostPosted: Tue Jul 23, 2013 8:52 am
by atrus80
Thanks for the effort, we just tried this file and we get the following 2 errors:

COM_VIRTUEMART_MIGRATION_WARN_VM1_EXTENSIONS
Warning: require_once(/home/qualityb/public_html/administrator/components/com_virtuemart/virtuemart.cfg.php) [function.require-once]: failed to open stream: No such file or directory in /home/qualityb/public_html/modules/mod_vm_ajax_search/ajax/index.php on line 90

Fatal error: require_once() [function.require]: Failed opening required '/home/qualityb/public_html/administrator/components/com_virtuemart/virtuemart.cfg.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/qualityb/public_html/plugins/system/yagendoo_framework/classes/3rdparty/phpQuery/:/home/qualityb/public_html/plugins/system/yagendoo_framework/classes/3rdparty/phpQuery/plugins/') in /home/qualityb/public_html/modules/mod_vm_ajax_search/ajax/index.php on line 90

Would appreciate any assistance!

Rgrds,
Chris

Re: Virtuemart Ajax Search - modify search results

PostPosted: Tue Jul 23, 2013 4:40 pm
by mo@.....dk
I think you are using Virtuemart 1.xx

See this part of the code:

Code: Select all
      if (file_exists(JPATH_BASE.DS.'components'.DS.'com_virtuemart'.DS.'virtuemart_parser.php'))
      {
      define('VM1', true);
        require_once(JPATH_BASE.DS.'components'.DS.'com_virtuemart'.DS.'virtuemart_parser.php');
        require_once(JPATH_BASE.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'virtuemart.cfg.php');
        include_once( ADMINPATH.'/compat.joomla1.5.php' );
        require_once( ADMINPATH. 'global.php' );
        require_once( CLASSPATH. 'ps_main.php' );
        require_once( CLASSPATH. 'ps_product.php' );
        require_once( CLASSPATH. 'ps_database.php' );
      require_once( CLASSPATH. 'phpInputFilter/class.inputfilter.php' );
      $vmInputFilter = new vmInputFilter;
      }

Re: Virtuemart Ajax Search - modify search results

PostPosted: Tue Jul 23, 2013 4:49 pm
by atrus80
Hmm, that's strange.. We are using VM2.0.22a

Rgrds,
Chris

Re: Virtuemart Ajax Search - modify search results

PostPosted: Mon Jul 29, 2013 1:44 am
by michel.hondeveld@.....com
mo@geniusdesign.dk wrote:Try out the search in the top of the page on my clients site:
http://www.printmore.dk/

I have attached the index.php file as a zip-file, just in case you want to use the alterations I have made.


I realy love the changes that are made, and it is fast too.
But I'm pretty sure that the index.php file is not the only file that is adjusted. Is it possible for you to share the complete mod_vm_ajax_search folder?

Hope You can help me out.

Re: Virtuemart Ajax Search - modify search results

PostPosted: Wed Jul 31, 2013 2:39 pm
by admin
mo@geniusdesign.dk wrote:I think you are using Virtuemart 1.xx

See this part of the code:

Code: Select all
      if (file_exists(JPATH_BASE.DS.'components'.DS.'com_virtuemart'.DS.'virtuemart_parser.php'))
      {
      define('VM1', true);
        require_once(JPATH_BASE.DS.'components'.DS.'com_virtuemart'.DS.'virtuemart_parser.php');
        require_once(JPATH_BASE.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'virtuemart.cfg.php');
        include_once( ADMINPATH.'/compat.joomla1.5.php' );
        require_once( ADMINPATH. 'global.php' );
        require_once( CLASSPATH. 'ps_main.php' );
        require_once( CLASSPATH. 'ps_product.php' );
        require_once( CLASSPATH. 'ps_database.php' );
      require_once( CLASSPATH. 'phpInputFilter/class.inputfilter.php' );
      $vmInputFilter = new vmInputFilter;
      }


because virtuemart team had included the virtuemart_parser.php file in the latest VM releases, it breaks the compatiblity with this extension and thus the update is needed directly from our site, or a deletion of the virtuemart_parser.php file is needed. I never understood why they had included the file when it only breaks everything.

http://www.rupostel.com/mod_vm_ajax_search_for_vm2.zip

there are some known issues currently
- some SEF extensions, apache rewrites or fastcgi configuration improperly detects the root of the files from which the system is being executed and thus causing image issues, language or link issues
-> we have the extension installed on our demos at vm2onj25.rupostel.com but with the default joomla router, default language filters in j2.5 or artio sef enabled (or disabled), we cannot replicate these issues

Re: Virtuemart Ajax Search - modify search results

PostPosted: Thu Aug 01, 2013 8:14 am
by atrus80
Thanks Stan,

Any chance to implement the modified index.php of the user above with your extension for VM2?

Rgrds,
Chris