VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Themes & Layout Problems and Customization VM 1.1 => Topic started by: markvding on August 08, 2013, 10:28:02 am

Title: Tutorial - Hidden Captcha for Product Inquiry (Ask a Question) to Reduce Spam
Post by: markvding on August 08, 2013, 10:28:02 am
Are you sick and tired off receiving those spam messages in your mailbox which look like regular product inquiries? Then I have got the solution for you. Now Joomla! 1.5 and VirtueMart 1.1.19 are no longer actively support, I see an increase off spam on my customers webshops. Reducing the spam is possible by making some minor changes to your virtuemart files.

Effected files:
/administrator/com_virtuemart/classes/ps_communication.php
/components/com_virtuemart/themes/YOURTEMPLATE/templates/pages/shop.ask.tpl.php
/templates/YOURTEMPLATE/css/template.css


Around line 130 in ps_communication, right after:

Code: [Select]

global $vmLogger,  $Itemid, $_SESSION, $VM_LANG,$mosConfig_live_site,$mosConfig_lang, $sess;


add:

Code: [Select]

if(!empty($_POST['kaasvlinder'])) {
// it's spam
} else {
// a real user is asking for more info


Next, in your shop.ask.tpl.php file, add the following lines around line 32 / 33:

Code: [Select]
<label for="kaasvlinder" class="kaasvlinder">Are you a human? Then please let this empty</label>
<input type="text" name="kaasvlinder" id="kaasvlinder" class="kaasvlinder" />

In your stylesheet, please add

Code: [Select]
.kaasvlinder { display: none; }


That's it! Happy coding!
Title: Re: Tutorial - Hidden Captcha for Product Inquiry (Ask a Question) to Reduce Spam
Post by: endorfin_kaan on August 27, 2013, 22:36:15 pm
where the following code to implement them? (template.css ,index.php ?)

In your stylesheet, please add

Code: [Select]

.kaasvlinder { display: none; }



That's it! Happy coding!


  ====> Is it possible to share these files here?
Effected files:
/administrator/com_virtuemart/classes/ps_communication.php
/components/com_virtuemart/themes/YOURTEMPLATE/templates/pages/shop.ask.tpl.php
/templates/YOURTEMPLATE/css/template.css

thank you
Title: Re: Tutorial - Hidden Captcha for Product Inquiry (Ask a Question) to Reduce Spam
Post by: _Brake_ on September 26, 2013, 11:23:19 am
Is this solution still working? Because it is generating errors for me after clicking the send button :(
Title: Re: Tutorial - Hidden Captcha for Product Inquiry (Ask a Question) to Reduce Spam
Post by: datnengiagoc on December 09, 2013, 05:38:02 am
Is this solution still working? Because it is generating errors for me after clicking the send button :(

I also like this, hoping for help me