News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Virtuemart search module

Started by grantell, January 21, 2012, 19:15:07 PM

Previous topic - Next topic

grantell

Hi all.
I have a question that I hope someone may be able to help me with.
In the virtuemart searc module I would like to move the Search button from beneath the search text and have it at the right hand end of this input field and reduce the width of the button.
Also is it possible to change the search button to an image such as a magnifying glass or something similar?

Any assistance would be greatly appreciated.

Thank you.


RobertL

Was just doing a fix yesterday for search module, figured I'll share it here, though you might not need it anymore.

This relates to VM2.0.6 and accompanying search module version.
Much of what you were after is in the module parameters Extensions > Module Manager > VM - Search in Shop. There you can move position of the text/image to wherever you want and change it's size.

But there is a problem with displaying a custom image as a button, thankfully solution is a 2 minute fix. Edit file modules/mod_virtuemart_search/tmpl/default.php


You'll notice a simple typo in file path on Line 7 looking for component, it should be components
Wrong:
$image = JURI::base().'component/com_virtuemart/assets/images/vmgeneral/search.png' ;

Correct:
$image = JURI::base().'components/com_virtuemart/assets/images/vmgeneral/search.png' ;

Now just copy your search image to components/com_virtuemart/assets/images/vmgeneral/ since there isn't one there  :) Just google for royalty free images and you'll find stacks available if you don't have one.


If you want to change it's size and remove the border around image, just edit that same file as above and change css style on Line 11:
Original:
$button = '<input style="vertical-align :middle;height:16px;border: 1px solid #CCC;" type="image" value="'.$button_text.'" class="button'.$moduleclass_sfx.'" src="'.$image.'" onclick="this.form.keyword.focus();"/>';

Worked best for me, image to the right of input field:
$button = '<input style="vertical-align :middle;height:20px;margin-left:5px;" type="image" value="'.$button_text.'" class="button'.$moduleclass_sfx.'" src="'.$image.'" onclick="this.form.keyword.focus();"/>';

lipes

Its possible to have displayed Result with Related / Similar Names like some search engines doing "did you mean".

For example if we got this product SKU: F67K LDI-7
and some costumer / visitor write this: f67kldi7 .. we could display that product like a option "did you mean: F67K LDI-7 (category name) etc.."
or the Costumer only write f67kldi
and we got some products like F67K LDI-1 , F67K LDI-2 ... F67K LDI-7 .. F67K LDI-8 ...
the search will display all those similar/ related results...
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25