A Joomla 1.5 (Native) module for live (AJAX) searches of Virtuemart 1.1.0 product names - Joomla & VirtueMart Tips & How To's

A Joomla 1.5 (Native) module for live (AJAX) searches of Virtuemart 1.1.0 product names. The product search module can search just for product names or product names, descriptions and category names.

Home Joomla - VirtueMart VirtueMart Live Product

Wed

11

Mar

A Joomla 1.5 (Native) module for live (AJAX) searches of Virtuemart 1.1.0 product names
  • Joomla 1.5
  • mod_virtuemart_live_product
16.06.2009
A new version released today with all bugs in IE fixed.
If you have an old version please download mod_virtuemart_live_product_1.1.2.j15.v0.6.zip and replace the previous one. (uninstall/re-install)
Added an option added in the backend to input the folder for url-redirect if your installation is not in the root.
The language string for no results has to be changed as well. See below.
VirtueMart Live Product Search
A simple module for live VirtueMart product searches.
This is based on the excellent mod_pixsearch live search module designed by Henrik Hussfelt

You can try it on the right side ... and download it here - Download

How it works -

  • The string that is typed in the search box is sent as a search request to the normal VirtueMart search page.
  • The returned result has the product names and product page urls extracted and displayed under the search box.
  • If there is only one result a message is displayed and the browser is re-directed to the product page.
  • If there is no result this is displayed in the results box.
  • You can select via the back-end whether you want to search only for "Product Names" or "Product Names, Descriptions, SKU and Categories".
  • A minimum of 3 letters is needed, if you want one or two letter minimum this can be changed in the code but a hack is also needed in the VirtueMart core file classes/ps_main.php around the line 1260.

    Joomla 1.5 VirtueMart Live Product Search logo
    if( $strlen > 2 ) { 
    change to
    if( $strlen > 0 ) { 
    for 1 letter etc....


Installation -


  • Install in the normal way via Extensions-->Install/Uninstall.
  • Enable the module in the desired position.
  • To detect the "no result" condition you need to add a class to the "no result" text in all the relevant VirtueMart language files.
    Open administrator/components/com_virtuemart/languages/common/your_language.php and on ~ line 57 add these span tags to the translation text like so...

    'PHPSHOP_NO_SEARCH_RESULT' => 
    'Your search returned 0 results.
    '


    Do this for each installed language.
  • English, German, Czech, Hungarian, Dutch & French language files are included.
    Any other translations you make please include in a comment below, it's only 6 lines :lol:

Configuration -


  • A text can be included before and after the search box.
  • If your installation is not in the root you can input the sub-folder with a trailing slash.
  • "VM Searchpage URL" refers to the VirtueMart Extended search url
    (normally " index.php?option=com_virtuemart&page=shop.browse&Search=Search")
  • The default CSS is at
    "your-site/modules/mod_vm_live_product/css/vm_live_product_default.css".
  • The absolute positioned results div can be adjusted by margins in the parameters.
  • Choose whether you want to search by "Product Names" or "Product Names, Descriptions, SKU and Categories".
  • You must select the correct VirtueMart Browse Template for the extraction to be able to find the resulting product names and urls.
    You can see which template your using at
    Components-->Virtuemart--> and then Administration-->Configuration-->Site-->Category Template.
    It doesn't function with 'Managed'or 'browse_lite_pdf'.
    If you have modified the selected Template enter "other" and fill in the element in the field below.


Fine tuning if a non-standard VirtueMart Browse template is used.

VirtueMart Live Product Search
The module uses Javascript to extract the product names and urls from the returned search results.
If you have changed the standard distributed templates the Javascript needs to know in which elements it has to look for this information.
To do this you need to look at the source code of a returned search result and find which element is unique to the product name.

Example


Do a normal VirtueMart search in your shop for a search phrase that will return more than one result.
Then display the source code of the results page and find the first product title.
In this example it is contained within a h3 tag. So that is the element we would insert in the "Other Template Element" field.
Code extract
<td><div class="browseProductContainer"> <div class="jamod module"><div><div><div> <h3 style="border-bottom: none;padding:10px 10px 0px 10px;text-align:center;min-height:30px"> <a style="font-size: 13px; font-weight: normal;text-decoration:none;" href="/Piatnik-Deutschland/Spiele-fur-Familien-Freundeskreis/ab-4-Jahren/Activity-Kinder.html?keyword=kinder"><b>Activity Kinder</b></a> </h3> <p style="height:53px"> <span class="productPrice"> EUR 18,89 inkl. 19 % MwSt. </span>
etc etc .....

Updates

Paypal Donation

If you use this module on your site please donate a small amount.
Any donation amount appreciated.

Version 0.4
Better handling of no result - now the "no result" message is displayed in the results box

Version 0.5
Now able to select via the back-end whether you want to search only for "Product Names" or "Product Names, Descriptions and Categories".

Version 0.6
All bugs in Internet Explorer fixed.
Option to add non-root installation folder.

If you have any comments, suggestions or need any help please leave a comment below.
If you use it on a commercial site (if it's Virtuemart I guess it's got to be commercial ;) ) please leave a small donation.
Thanks.

If you need computer software certification the links below may be of interest!

PassCertification  provides latest  VMware Certification Preparation  materials including Apple Certification Preparation Questions & Answers and EMC Certification Preparation  sample Q & A. Get our FileMaker 10 Certification Preparation and FileMaker 11 Certification Preparation training materials with 100% money back guarantee.
Last Updated on Wednesday, 02 January 2013 17:17
 
VirtueMart
Your Cart is currently empty.

Paypal Donation

If you use this module on your site please donate a small amount.
Any donation amount appreciated.

Latest Joomla & VirtueMart Tips

See all tips & examples

VM Live Product Search

VirtueMart A-Z Module

Use the letters C or S as there's not many products in the test shop!
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9

Letter D will return one result i.e. the product page.



A Joomla 1.5 (Native) module for live (AJAX) searches of Virtuemart 1.1.0 product names|Joomla & VirtueMart Tips & How To's



A Joomla 1.5 (Native) module for live (AJAX) searches of Virtuemart 1.1.0 product names. The product search module can search just for product names or product names, descriptions and category names.


product, search, virtuemart, result, names, results, template, certification, live, preparation, box, page, version, language, module, returned, code, displayed, installation, browse, element, mod, normal, select, descriptions, site, text, download, css, categories, add, root, option, url, folder, changed, urls, install, php, leave


guru

We use cookies to improve our website and your experience when using it. Cookies used for the essential operation of the site have already been set.
To find out more about the cookies we use and how to delete them, see our privacy policy.

I accept cookies from this site.