News:

Looking for documentation? Take a look on our wiki

Main Menu

Terms of service not checked HIGHLIGHTING

Started by aeiweb, November 16, 2012, 17:44:21 PM

Previous topic - Next topic

aeiweb

SO! Got it configured that when you check out you must agree to the terms of service. At the moment you can add stuff to your cart, start your checkout, and it takes you to fill in your address and such, then kicks you back to the cart, as it should.

BUT

When you try to finalize your checkout and HAVE NOT agreed to the terms of service, IT DOES NOT WARN YOU that thats why you can't check out. If the TOS isn't agreed to, it just loops you back into the cart over and over again. I need a popup or a note or something that says "AGREE TO THE TERMS OF SERVICE JERK" and then you can checkout. Just a little notice, nothing crazy.

Any ideas?

aeiweb

Sorry, but has anybody got an update on this?  Its the last thing I need for the site to launch!

bytelord

Hello,

First of all you have not say which version of joomla and vm2 you are using. To your issue is been inform you thought joomla system messages, usually at the top of the page "Please accept the terms of service to confirm" ...
may be you have "hide" or you are using any joomla template that hides system messages, check it out, this is not related to vm2 miss functionality.

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

dsherwin

Hi,

Hoping someone can help, if the user does not click on the checkbox for terms of service and clicks on "Check Out Now", the page is reloaded without any indication that the user did not tick the checkbox.
Is there any way to highlight this to the user?

Thanks
Darragh


virtuemat 2.0.20b
Joomla 2.5.9


jenkinhill

You may need to add this code to your Joomla template header:

<jdoc:include type="message" />
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

dsherwin

Figured it out, the problem is that clicking on the "Check out now" calls submit on the form without checking if the checkbox is ticked.

The fix is to add the following views/cart/tmpl/default.php (after line 61)

$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

$checkout_link_html = '<a class="vm-button-correct" href="javascript:document.checkoutForm.submit();" ><span>' . $text . '</span></a>';

to

$checkout_link_html = '<a class="vm-button-correct" href="#" ><span>' . $text . '</span></a>';


This will block the form from being submitted until the user has clicked the Terms of Service checkbox and highlight it in red

Regards
Darragh

servlet

In
com_virtuemart/views/cart/tmpl/default.php
Just replace this line:
echo VmHtml::checkbox ('tosAccepted', $this->cart->tosAccepted, 1, 0, 'class="terms-of-service"');
with this:
echo VmHtml::checkbox ('tosAccepted', $this->cart->tosAccepted, 1, 1, 'class="terms-of-service"');

or change value from 0 to 1
Он-лайн магазин за фототапети http://mishelfoster.com