|
Page 1 of 2 Anyone who's setup an online store with Virtuemart will know about the "Ask a question about this product" page being spammed. Opinion is divided between introducing a CAPTCHA system (requires a lot of core hacks) to removing the link all together. This is my solution which is somewhere between the two.
If the product "Ask a question" page is visited, this code alteration will ask the user to login, or register before asking a question.
This alteration only requires changes to shop.ask.tpl. Therefore you can safely upgrade VirtueMart without fear of loosing the changes.
Backup your files before you do this, or indeed any code change of any kind. You've been warned
Note: Ive attached to the bottom of this article a pre-modified version of shop.ask.tpl.php (zipped) for Virtuemart 1.1.4. Ive not tested it on other versions.
Load up the file /components/com_virtuemart/themes/<your theme>/templates/pages/shop.ask.tpl.php in your editor, you should see something like this
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
mm_showMyFileName( __FILE__ ); if ( $set == 0 ) { // This is the enquiry form! $validate = vmIsJoomla( '1.5' ) ? JUtility::getHash( $mainframe->getCfg( 'db' ) ) : mosHash( $mainframe->getCfg( 'db' ) ); ?> <br /> <a class="button" href="/<?php echo $product_link ?>"><?php echo $VM_LANG->_('VM_RETURN_TO_PRODUCT') ?></a> <br /><br /> <form action="<?php echo $mm_action_url ?>index.php" method="post" name="emailForm" id="emailForm"> <label for="contact_name"><?php echo $VM_LANG->_('NAME_PROMPT') ?></label> <br /><input type="text" name="name" id="contact_name" size="80" class="inputbox" value="<?php echo $name ?>"><br /><br /> <label for="contact_mail"><?php echo $VM_LANG->_('EMAIL_PROMPT') ?></label> <br /><input type="text" id="contact_mail" name="email" size="80" label="Your email" class="inputbox" value="<?php echo $email ?>"><br /><br /> <label for="contact_text"><?php echo $VM_LANG->_('MESSAGE_PROMPT') ?></label><br /> . . .
|
Continued on the next page.....
|
|
Last Updated on Monday, 23 November 2009 21:29 |