turn off/disabling the shop "ask product" form in virtuemart

Most people want to disable, remove or turn off the "Ask a question about this product" in vitruemart for joomla because it attracts alot of comment spam. If your getting lots of random messages in you email box with thumbnails of the products in your online shop which is a virtuemart/joomla shop, then chance what's causing this is the link exists when there are products with no price. It links to a from with no way of stopping robots from spamming you: Heres how to fix things.

There are three options:

1) Turn off the link (this wont solve the problem but is there for reference)
2) Delete the form completely (note, it is not good enough to simply turn the link to the form page in the shop, because it wil still actually exist an Spammers will still find it via Google.
3) Use Re-Captcha to thwart spammers and leave the funtion available:

NOTE: before we start, I often refer to the file:  joomla\components\com_virtuemart\themes\default\templates\pages\shop.ask.tpl.php   this may not be the right file if you have a template installed, if so you will need to replace the bit that says default with the location of your virtuemart template. In this case the location would be joomla\components\com_virtuemart\themes\YOUR-VIRTUEMART-TEMPLATE-HERE\templates\pages\shop.ask.tpl.php

1) To turn off the link. Go into the Joomla Administrator backing and choose the virtuemart plugin. Under configuration there is an option to "show prices" (in the "global" tab under the section "Price Configuration". Many people use Virtuemart as a catalogue system and don't need to show prices. When the price is left empty thats when the "Ask a question about this product" link appears. To turn it of just uncheck "show prices". NOTE: If you turn off the link, the page is still accessible and any spam bot that knows about might continue to visit it an sen you spam. You might want to try option 2:

2) Delete the form completely. A rather simple solution is to delete the contents of the form page,

If you think you're not need the form that people can use to ask a question about a product, then why not remove it. Turn it off (as in option 1 above) and the edit the php file found here:  joomla\components\com_virtuemart\themes\default\templates\pages\shop.ask.tpl.php    now just delete everything ans save the file back to the server. Done. No more spam.

3) Using Re-Captcha:

Signing up for reCaptcha
Downloading and configuring the JEZ reCAPTCHA Integrator plugin for Joomla
Add a single word of code to this file: joomla\components\com_virtuemart\themes\default\templates\pages\shop.ask.tpl.php

Part 1
Go to http://recaptcha.net/.  Sign up for an reCaptcha account so you can get a public and private key (you can use a google account for this).  You will need these keys in part 2.

Part 2
Go to  http://www.joomlaez.com/ and download reCAPTCHA Integrator Plugin for Joomla. and install it. In the Joomla administrator backend, go to the plugin manager and open the reCAPTCHA Integrator Plugin. Then:
    •    Enable the plugin
    •    Enter the public and private keys from part 1 (above)
    •    Set Inclusion Syntax to YES
    •    Set Auto-verify to YES
    •    Apply or save the settings

Part 3
Edit the file: joomla\components\com_virtuemart\themes\default\templates\pages\shop.ask.tpl.php
Look for the line which say something like: <input type="button" name="send"...
Above this line, add the text:      {captcha}

Save the file (and make sure it's uploaded to the server). Now you're done.

Now, whenever anyone goes to a product page and clicks the link "Ask a question about this product" there should be a reCAPTCHA box at the bottom of the page.

Posted in Joomla