Tip: Add Captcha To Stop Product Inquiry Spam From VirtueMart 1.1.9

Recently a client of mine started receiving spam mail through VirtueMart’s product inquiry feature. This makes perfect sense since there is no captcha on that form. I wonder how in the 21st century we still allow such feature to exist without any protection.



Here’s how to add captcha to the VirtueMart 1.1.9 product inquiry form really simply. 


1. Generate a picture with a calculation or a drawing of your choice to display to the users. 

2. Upload this image to your joomlaroot.com/images/yourimagename.gif

3. Open \components\com_virtuemart\themes\default\templates\pages\shop.ask.tpl.php (if you have another theme then open this from your theme folder)

4. Backup this file (in case things wont work the way you want)

5. Delete all its content and paste this code into it

6. On the lines 59-60 replace the value 0 with the answer to your picture question that you made in Step 1.

7. Save and test.


That’s how I added a simple Captcha check to VirtueMart’s product inquiry form. 

Please comment and share and Like Joomlaboy on Facebook and Follow on Twitter. 

Post Author: Tom Pai