VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: whizzzwebdesign on October 01, 2017, 14:26:45 PM

Title: Terms of Service not validated despite set to mandatory
Post by: whizzzwebdesign on October 01, 2017, 14:26:45 PM
Hi there,

On our live page schenkelvermessungen.ch (Joomla 3.7.5 / VM 3.2.4 / PHP 7.0.23) we've set the TOS field to mandatory for all check-outs. However, if the user "forgets" to click the checkbox, there is no error message shown and the order is immediately accepted. In Swiss law, the vendor has to proof that the user indeed has accepted TOS. Unfortunately, this is not possible here.

We've found quite a bit of same issues on the forum, but they are rather old and referring to previous VM versions.

Thanks for your help. Any tip how to solve this is highly appreciated.

Best regards from Switzerland
Fabian
Title: Re: Terms of Service not validated despite set to mandatory
Post by: jenkinhill on October 01, 2017, 15:07:22 PM
First check if it is a template issue by testing with Protostar.

If still an issue then check in shopper fields that the agreed (checkbox) and tos (custom) are both set to required, and "Must agree to Terms of Service on EVERY ORDER" is selected in VM Configuration/Checkout.
Title: Re: Terms of Service not validated despite set to mandatory
Post by: whizzzwebdesign on October 03, 2017, 00:00:36 AM
Dear Kelvyn,

Thank you very much for your help. I confirm that we've now set both fields (agreed checkbox and tos custom) to required and the "must accept... on EVERY ORDER" is also activated. Now, the field get's indeed validated. But, and that was a remark from our customer, the message "please accept the terms of service" appears already when the shop customer clicks on the cart. Actually, the message should only be shown if she/he clicks on the "buy" button and not already at the very beginning. We've tested that with the transform template as well as with the Protostar (same behaviour).

Do you have an advise how we have to set up VM that the TOS validation (and therefore also the message) only takes place when the user clicks on "buy"?

Thank you and best regards
Fabian
Title: Re: Terms of Service not validated despite set to mandatory
Post by: GJC Web Design on October 03, 2017, 23:44:48 PM
what do u mean by "buy" .. as in confirm the order?

why is it a problem that the message is shown during the cart transaction.. I think this is for every cart the same?

There is a var available that is set by the cart confirm (last stage) to hide the T&C till then (and disable validation?)  you can use JS triggered by this var or the state of the confirm button etc
Title: Re: Terms of Service not validated despite set to mandatory
Post by: whizzzwebdesign on October 04, 2017, 10:08:57 AM
Thank you very, very much for your anser.

Yes, we mean "confirm the order". The template that we use ("transform" from virtuemarttemplates.net) shows this notification in an overlay box (hiding the content below). Thus, usability is not satisfying enough for our customer and they want to see the "error" message only if the enduser forgets to click the TOS checkbox.

Do you mind giving us a short instruction where and how we can adapt or setup the var you've mentioned?
Title: Re: Terms of Service not validated despite set to mandatory
Post by: jenkinhill on October 04, 2017, 12:31:51 PM
So this is related to your template layout not to VirtueMart function. In that case you should edit the template overrides to fix the issue or maybe use css to change the layout. You can ask virtuemarttemplates.net about this, maybe you need an update of that template.  http://forum.virtuemart.net/index.php?topic=108212.0
Title: Re: Terms of Service not validated despite set to mandatory
Post by: whizzzwebdesign on October 04, 2017, 14:02:45 PM
Thanks Kelvyn,

We're already using the most recent version of that template (issued on 20th September 2017). However, we have the same situation if we switch back to the protostar template. As initially mentioned, there is either no validation of TOS (if "agreed" and "TOS" is not set as required) or (if both are set as required) the message appears always on the cart checkout page (also on protostar). Both ways are not accepted by our customer, the first one is a real legal issue in Switzerland, the second one is a pure usability issue. We still believe that TOS should only be validated if the user clicks on the confirm order button, not earlier.

It would be great if somebody could give us a tip where and how we can adjust the "var" as mentioned by GJC Web Design.
Title: Re: Terms of Service not validated despite set to mandatory
Post by: GJC Web Design on October 04, 2017, 20:58:44 PM
cannot advise from afar as i have no idea how your template triggers the modal etc

the var is from memory  $this->checkout_task  think its state is either confirm or check_out

just echo it out
use this to prevent the modal
Title: Re: Terms of Service not validated despite set to mandatory
Post by: whizzzwebdesign on October 08, 2017, 18:37:27 PM
Thank you all for the contribution on that topic.

We've been able to solve that issue with the installation of the "VP One Page Checkout" plugin provided by virtueplanet.com.
:)