web design, England, Britain, UK, belgium
 

Joomla & VirtueMart Tips & How To's

GJC Web Design UK Joomla & VirtueMart how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help

A collection of help articles and coding examples for Joomla & Virtuemart

Belgium, VirtueMart & Joomla Web Design England UK Britain & Germany

Joomla, VirtueMart, how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help GJC Website Design UK, Joomla Developer, VirtueMart Developer, Template Developer, web site designs, England, Britain, UK, Belgium, search-engine optimisation (SEO). Multilingual.

Home Joomla - VirtueMart Joomla & VM How To's
Joomla & VirtueMart Tips & How To's
joomla logo virtuemart logo




Joomla is a very popular and extendable CMS (Content Management System) that is used by 10's of thousands of websites.
VirtueMart is the e-commerce component for Joomla.
We at GJC Web Design have used this system in many of our designs including this one. In fact we specialise in developing, modifying and adapting Joomla & VirtueMart websites.
If you need any help or advice just contact us.

Below are links to various tips, developments and examples.

Sat

28

Mar

VirtueMart 1.1 Alpha Numeric search module

An A to Z, 0 to 9 (Alpha-numeric) search/listing module for VirtueMart.


Search for VirtueMart products by first letter or number and display the results in the standard VirtueMart search results page.
If only one result is found it redirects to the product page.
You can try it here - Demo ... and download it here - Download

How it works -

It just utilises the standard Virtuemart search but filters it by product name and 1st letter or number.
It needs the installation of this module and two very small hacks in classes/ps_main.php and html/shop_browse_queries.php

The module installs as normal and publish it somewhere.
The only only parameters are pre and post text and module classes.
It's simply a list of search urls and is very simple to style differently directly in the mod_az_virtuemart.php file or with css.

VirtueMart 1.1 Alpha Numeric search module parameters

Styling

Give the module a class then style the resulting menu class
a.mainlevel-az {
padding-left:5px;
text-decoration:none;
}
... An image for each letter would be even better.

Source Changes Needed

The change needed to html/shop_browse_queries.php is to make a new $search_limiter parameter so it only searches for the 1st letter.
around line 110 insert after switch($search_limiter) {
case "az":
$sq .= "\n `#__{vm}_product`.`product_name` LIKE '$searchstring%' ";
break;
so it looks like
switch($search_limiter) {
case "az":
$sq .= "\n `#__{vm}_product`.`product_name` LIKE '$searchstring%' ";
break;
case "name":
$sq .= "\n `#__{vm}_product`.`product_name` LIKE '%$searchstring%' ";
break;
In the file classes/ps_main.php the function "vmGetCleanArrayFromKeyword" ignores the search unless there's more than 2 letters.
I change this to 1 letter to get it to work.
I tried to use a different keyword parameter e.g. keyword3 but I couldn't get it to work but this would be a "nicer" way to do it rather than hook in to the already used parameter.
Perhaps someone can achieve this?

So in classes/ps_main.php around the line 1260 change the
if( $strlen > 2 ) {
to
if( $strlen > 0 ) {

Updates!


Version 0.2
Code re-written so that the urls are formed by php, a smaller package now (ver0.2)

Version 0.3
Fixed problem with search urls and SEF components

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.
Last Updated on Saturday, 12 December 2009 12:20
 

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


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
 
«StartPrev1112NextEnd»


Page 12 of 12
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.

VM Live Product Search

GJC Web Design UK Joomla & VirtueMart how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help

A collection of help articles and coding examples for Joomla & Virtuemart

Belgium, VirtueMart & Joomla Web Design England UK Britain & Germany

Joomla, VirtueMart, how to, tips, tricks, coding examples, html, php, tutorial, 101, useful hints, help



Joomla & VirtueMart Tips & How To's



GJC Website Design UK, Joomla Developer, VirtueMart Developer, Template Developer, web site designs, England, Britain, UK, Belgium, search-engine optimisation (SEO). Multilingual.


website design UK, Joomla Developer, VirtueMart Developer, Joomla, Joomla Templates, web site design, England, Britain, UK, Belgium, VirtueMart design,website, webdesign, webpage, Belgium, Liège, multi-lingual, multilingual, seo, small medium business ,

|

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.