News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to accept Terms of Service without page refreshing.

Started by kaiserdom, June 05, 2015, 13:24:22 PM

Previous topic - Next topic

kaiserdom

Hello everybody

I'm running Virtuemart 3.0.9 on Joomla 3.4.1 and I'm wondering if there is a way to accept (by checking) the terms of service, without that annoying and time consuming page reloading.
Thank you for your time.

AH

The page refresh changes the checkout status to confirm and pay

Are you sure you wish to change this functionality?

You will have to click confirm which will refresh the page

and then click confirm and pay
Regards
A

Joomla 4.4.5
php 8.1

kaiserdom

#2
Thanks for your advice.
I don't know...it seems a little weird. In every e-shop I know you just tick the check-box, or it is pre-ticked, without page reload.

AH

This behaviour is not wanted by some store owners so you can change this by creating an override.

ON line 63 (or near)

There is the addition of javascript which forces a page reload when TOS is checked

$this->addCheckRequiredJs();

You can do a template override to remove this behaviour if required -

copy this file:

components\com_virtuemart\views\cart\tmpl\default.php


TO

templates/YOURTEMPLATEDIRECTORY/html/com_virtuemart/cart/default.php

Then comment out the line and save:-

//$this->addCheckRequiredJs();

The page will not refresh when the TOS is checked.
Regards
A

Joomla 4.4.5
php 8.1

kaiserdom

#4
 I have almost everything overrided on my site but without safety risks. This one seems to create law loopholes on terms of service acceptance. In any case you are the man! ;)

Milbo

Quote from: kaiserdom on June 08, 2015, 14:41:27 PM
This one seems to create law loopholes on terms of service acceptance. In any case you are the man! ;)

Hm? The JS does not confirm for you. Just in case the checkbox was the last missing condition, it shows you directly the "confirm" possibilty. I cant see any problem with the law here. It just spares the users to click again. We may use this script for even more options. For example, when you click the checkbox "use as ST the BT address", the cart must be reloaded to recalculate the shipments.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

AH

Some users just do not want the checking of the confirm terms of service to do anything to the cart page.  It is just a user experience preference.

Unlike the BT and ST addresses selection, there is unlikely to be a need to reload/recalculate the prices in the cart when TOS is checked.
Regards
A

Joomla 4.4.5
php 8.1