Author Topic: Bug fix for Terms of Service in Checkout  (Read 3013 times)

dsherwin

  • Beginner
  • *
  • Posts: 4
  • Skype Name: darraghserwin
Bug fix for Terms of Service in Checkout
« on: April 25, 2013, 00:08:57 am »
The Terms of Service on the cart is not being validated before the user goes to the checkout. (Virtuemart 2.0.20b, Joomla 2.5.9)

The fix is to add the following views/cart/tmpl/default.php (after line 61)
Code: [Select]
$document->addScriptDeclaration ("
jQuery(document).ready(function($) {
$('a.vm-button-correct').click(function(event)
{
if( $('input#tosAccepted').is(':checked') )
{
document.checkoutForm.submit();
}
else
{
$('a.terms-of-service').css('background-color', 'red');
}
});
});
");
Change views/cart/view.html.php, line 141
from
Code: [Select]
$checkout_link_html = '<a class="vm-button-correct" href="javascript:document.checkoutForm.submit();" ><span>' . $text . '</span></a>';
to
Code: [Select]
$checkout_link_html = '<a class="vm-button-correct" href="#" ><span>' . $text . '</span></a>';

Thanks
Darragh