web design, England, Britain, UK, belgium
 
Ulti Clocks content

VirtueMart 1.1 Alpha Numeric search module

sand 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.
search, product, php, virtuemart, module, letter, classes, like, case, main, limiter, urls, change, parameter, break, searchstring, work, needed, queries, use, leave, version, file, class, strlen, style, browse, keyword, text, number, shop, switch, commercial, download, small, line, page, results, standard, html

Home Joomla - VirtueMart VirtueMart A-Z search

Sam

28.

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 ) {

Paypal Donation

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

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 Wink ) please leave a small donation.
Thanks.


Add this page to your favorite Social Bookmarking websites
Digg! Reddit! Del.icio.us! Mixx! Free and Open Source Software News Google! Live! Facebook! Slashdot! Technorati! StumbleUpon! Spurl! Newsvine! Furl! Fark! Yahoo! Netvouz! Mister-Wong! RawSugar! Ma.gnolia! Squidoo! DZone! Swik!
Zuletzt aktualisiert am Samstag, 12. Dezember 2009 um 12:20 Uhr
 

Add your comment

BoldItalicUnderlineStrikethroughSubscriptSuperscriptEmailImageHyperlinkOrdered listUnordered listQuoteCodeHyperlink to the Article by its id
Very HappySmileWinkSadSurprisedShockedConfusedCoolLaughingMadRazzEmbarrassedCrying or Very SadEvil or Very MadTwisted EvilRolling EyesExclamationQuestionIdeaArrowNeutralMr. GreenGeekUber Geek
Your name:
  The word for verification.
Lowercase letters only with no spaces.

The word for verification.<br/>Lowercase letters only with no spaces.
Word verification:

Titel:
Comment:
Comments (15)
Category search
15 Montag, 09. Januar 2012 um 09:34 Uhr
Vadik
Hello,

Thank you for a very good module!

How i can to make az search for category?
@fredy
14 Donnerstag, 05. Januar 2012 um 18:50 Uhr
GJC (Admin)
Hi,

Quite happy to hack it for you to provide by cat filtering.. if you pay my time of course.. Wink
Contact me via my contact page,

GJC
search result by current category
13 Donnerstag, 05. Januar 2012 um 18:16 Uhr
fredy
Before nothing, thank you for this good module.
I have the same question that 'IndiaPhpExpert'. I want only filter by the current category and this module give me the results by all the categories.
Another question is: I can filter directly by subcategories.
If my questions can't be answered and somebody knows a similar module or component even if payment, thank you
Results of issue
12 Dienstag, 07. Juni 2011 um 11:06 Uhr
Kirill
Hello. Thank you for your module!
Please tell me how can I do that when user click on the letter displayed immediately all the goods by default, but not only four first items.
@IndiaPhpExpert
11 Sonntag, 29. Mai 2011 um 18:55 Uhr
admin GJC
Everything is possible eventually given enough time and effort.. Wink
You would need to get the current category and include this in the search string
Is there a way to get serach result by current category
10 Sonntag, 29. Mai 2011 um 12:28 Uhr
IndiaPhpExpert
Hello,
This module always display result of all products from all categories, is there a way to show only search result from the current category only.

Regards
@Tiya
9 Dienstag, 19. April 2011 um 09:30 Uhr
admin
No idea, as it's a free download try it and see.......
virtuemart 1.6
8 Dienstag, 19. April 2011 um 09:02 Uhr
Tiya
I need to knowt IS this module compatible with virtuemart 1.6???
help!!!
7 Mittwoch, 06. April 2011 um 16:57 Uhr
Simone
how can i use this module without the numbers?I need only the alphabet....thank u
HElp
6 Mittwoch, 01. Dezember 2010 um 06:48 Uhr
Julio
I need to know if it works on:
Joomla Versión 1.5.18
VirtueMart 1.1.5 stable
....
When I tried to install it, show me this message:

JFolder::create: Path not in open_basedir paths
@Rodolfo Murrieta
5 Donnerstag, 06. Mai 2010 um 07:51 Uhr
GJC (admin)
Thanks Rodolfo, works perfectly! Mr. Green
Added to the download as mod_az_virtuemart_1.1.2.j15.ver0.4

Regards and thanks for the donation!
Almost perfect,
4 Donnerstag, 06. Mai 2010 um 00:58 Uhr
Rodolfo Murrieta
A very valuable piece of code!
HOwever, it lacks the generation of the proper ItemId for Joomla.
Inserting
$parentmenu = JSite::getMenu()->getActive()->tree[0];
and changing URLS to
...."&option=com_virtuemart&Itemid=".$parentmenu."'>"....
Do the trick
Thank!


// changed while running a function
$cart = $_SESSION["cart"];
$auth = $_SESSION["auth"];
$parentmenu = JSite::getMenu()->getActive()->tree[0];
?>






for($i="A";$i.$i." \n";
}
@MIchael
3 Donnerstag, 01. April 2010 um 18:55 Uhr
GJC
This requires one off coding to achieve.
If your interested drop me a mail from the contact page..
apha search within a category
2 Donnerstag, 01. April 2010 um 17:11 Uhr
MIchael
I need to have alpha search within each category, i saw your category demo, how do i set that up
THANKS!
1 Sonntag, 14. März 2010 um 14:34 Uhr
SKY
THANKS! Smile

Our Recommended Reading

For those interested in extending their knowledge of Joomla! & VirtueMart, Packt Publishing has an excellent range of help & how to books.
Listed below are some I can recommend.
Simply click on the images to be taken directly to their web shop.


Joomla! Social Networking with JomSocial
Joomla! Social Networking
with JomSocial

by Kwasi Boateng & Beatrice A. Boateng.
Joomla! 1.5 Multimedia
Joomla! 1.5 Multimedia
by Allan Walker.


Building job sites with Joomla!
Building job sites with Joomla!
by Santonu Kumar Dhar.

Joomla! Template Design: Create your own professional-quality templates with this fast, friendly guide
Joomla! Template Design: 2nd Edition
Create your own professional-quality
templates with this fast, friendly guide
by Tessa Blakeley Silver.
Magento: Beginner's Guide
Magento: Beginner's Guide by William Rice
is a must for anyone trying the
open-source e-Commerce solution.

Read the review

object-oriented-javascript-applications-libraries
Object-Oriented JavaScript by
Stoyan Stefanov gives you a very
comprehensive grounding in
the latest Javascript techniques.

Read the review
Joomla! Web Security
Joomla! Web Security
by Tom Canavan.

Joomla 1.5 Top Extensions Cookbook
Joomla 1.5 Top Extensions Cookbook by
Suhreed Sarkar is an ideal and concise round up of the extensions available for the Joomla! system.

Read the review

Showcase

  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow
  • An Image Slideshow

Paypal Donation

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

VM Live Product Search

Latest Joomla & VirtueMart Tips

See all tips & examples

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.



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.


search, product, php, virtuemart, module, letter, classes, like, case, main, limiter, urls, change, parameter, break, searchstring, work, needed, queries, use, leave, version, file, class, strlen, style, browse, keyword, text, number, shop, switch, commercial, download, small, line, page, results, standard, html