The product inquiry form doesn't have a captcha yet. So here's how I did it:
0. Back up everything.
1. I installed a component that would provide a failpage with a link back to the product, given the right options. Install com_fail.zip (attatched).
2. Put the following code in the ask form, which will either be in your flypage (components/com_virtuemart/themes/default/templates/product_details/whateverflypageyourusing.tpl.php) or shop.ask.tpl.php (components/com_virtuemart/themes/default/templates/pages/shop.ask.tpl.php).
<? if (file_exists($mosConfig_absolute_path.'/administrator/components/com_securityimages/client.php')) {
include ($mosConfig_absolute_path.'/administrator/components/com_securityimages/client.php');
// Note that this package name must be used on the validation side too! If both are not equal, validation will fail
$packageName = 'securityVMRegistrationCheck';
echo insertSecurityImage($packageName);
echo getSecurityImageText($packageName);
}
else if (file_exists($mosConfig_absolute_path.'/plugins/system/securityimages.php')) {
echo "<script type=\"text/javascript\" src=\"".JURI :: root()."/components/com_securityimages/js/securityImages.js\"></script>";
echo "<img id='captchaSecurityImages' name='captchaSecurityImages' src=\"".JURI :: root()."/index.php?option=com_securityimages&task=displayCaptcha\" />";
echo "<a href=\"javascript:askNewSecurityImages('captchaSecurityImages');\">";
echo "<img src=\"".JURI :: root()."/components/com_securityimages/buttons/reload.gif\" id=\"securityImagesContactCaptchaReload\" name=\"securityImagesContactCaptchaReload\" border=\"0\">";
echo "</a>";
echo "<input type=\"text\" name=\"securityVMRegistrationCheck_try\" />";
}?>
3. Back up your old ps_communications.php (administrator/components/com_virtuemart/classes/ps_communications.php)
4. Put in the new ps_communications.php (attached) or, if your old one is modified for some reason observe the changes and make them to your old one.
P.S. everything attached is zipped into one attachement. ALSO the ps_communications.php file provided will not work with an unmodified inquiry form.
[attachment cleanup by admin]