Virtuemart Ajax Search - modify search results

Please post your questions and problems with any of our extensions which you are using

Virtuemart Ajax Search - modify search results

Postby mo@.....dk » Mon Jun 10, 2013 3:41 pm

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?
mo@.....dk
 
Posts: 3
Joined: Mon Jun 10, 2013 3:31 pm

Re: Virtuemart Ajax Search - modify search results

Postby atrus80 » Mon Jul 22, 2013 4:13 pm

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
atrus80
 
Posts: 85
Joined: Mon Feb 06, 2012 6:22 pm

Re: Virtuemart Ajax Search - modify search results

Postby mo@.....dk » Mon Jul 22, 2013 5:25 pm

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.
Attachments
index.zip
(7.13 KiB) Downloaded 2514 times
mo@.....dk
 
Posts: 3
Joined: Mon Jun 10, 2013 3:31 pm

Re: Virtuemart Ajax Search - modify search results

Postby atrus80 » Tue Jul 23, 2013 8:52 am

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
atrus80
 
Posts: 85
Joined: Mon Feb 06, 2012 6:22 pm

Re: Virtuemart Ajax Search - modify search results

Postby mo@.....dk » Tue Jul 23, 2013 4:40 pm

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;
      }
mo@.....dk
 
Posts: 3
Joined: Mon Jun 10, 2013 3:31 pm

Re: Virtuemart Ajax Search - modify search results

Postby atrus80 » Tue Jul 23, 2013 4:49 pm

Hmm, that's strange.. We are using VM2.0.22a

Rgrds,
Chris
atrus80
 
Posts: 85
Joined: Mon Feb 06, 2012 6:22 pm

Re: Virtuemart Ajax Search - modify search results

Postby michel.hondeveld@.....com » Mon Jul 29, 2013 1:44 am

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.
michel.hondeveld@.....com
 
Posts: 1
Joined: Mon Jul 29, 2013 1:30 am

Re: Virtuemart Ajax Search - modify search results

Postby admin » Wed Jul 31, 2013 2:39 pm

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
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Virtuemart Ajax Search - modify search results

Postby atrus80 » Thu Aug 01, 2013 8:14 am

Thanks Stan,

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

Rgrds,
Chris
atrus80
 
Posts: 85
Joined: Mon Feb 06, 2012 6:22 pm


Return to VirtueMart and Joomla Extensions (free or paid)

cron