Author Topic: Agree to ToS required checkout problem  (Read 2348 times)

remeedella

  • Jr. Member
  • **
  • Posts: 62
Agree to ToS required checkout problem
« on: January 24, 2013, 02:23:21 am »
Hello,

I`ve been looking for this solution for several days and finally got help to come across a solution. Agree to Terms of Service requirement in virtuemart settings, require user to be registered to checkout and show terms of service on checkout are all enabled.

This problem exists on the latest virtuemart on a clean install. Some people encounter the problem where you do not put a checkmark in the box checking out from your cart and you can still continue to step 2.. Why is that? It makes me think that `require` setting doesnt work at all. It actually does, you are only prompted an error to agree to ToS at the end of checkout steps confirming your order. That, or if you have your shipping method (step 2) , your payment method (step 3) and your billing address all filled out and you haven`t agreed to Tos yet then you will be prompted. That seems confusing and inaccurate.

Users should be prompted immediately to agree to ToS or it should be written `by clicking check out now you have confirmed to the Terms of Service.` I would strongly recommend adjusting this on a future release of virtuemart or offering us the option as a setting in back-end. I looked like crazy for a solution to this problem that I don't think used to happen in in virtuemart 1 or older versions of Joomla, nobody had an answer.

Solution:

components/com_virtuemart/helpers/cart.php

move line 896

   if ($this->tosAccepted == 0) {

$userFieldsModel = VmModel::getModel('Userfields');

$required = $userFieldsModel->getIfRequired('agreed');
if(!empty($required)){
$redirectMsg = JText::_('COM_VIRTUEMART_CART_PLEASE_ACCEPT_TOS');
return $this->redirecter('index.php?option=com_virtuemart&view=cart' , $redirectMsg);
}
}

all that should be moved to line 770. Voila, ToS takes priority when trying to checkout, no need to be at the last step of checkout and confirming your purchase to be prompted, you are prompted immediately.

remeedella

  • Jr. Member
  • **
  • Posts: 62
Re: Agree to ToS required checkout problem
« Reply #1 on: January 27, 2013, 21:23:11 pm »
no one ran into this? :O I'd be surprised

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10144
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Agree to ToS required checkout problem
« Reply #2 on: January 31, 2013, 20:00:27 pm »
There is another post already exactly pointing out the same thing.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

remeedella

  • Jr. Member
  • **
  • Posts: 62
Re: Agree to ToS required checkout problem
« Reply #3 on: February 01, 2013, 22:22:15 pm »
Okay thanks Milbo. I literally searched the forum, joomla forum, google like crazy. There were no examples or fixes for this problem and I couldnt find the post you suggested. It took me days lol so I dont want anyone to have trouble with this either. I already showed this to Val. Thanks!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10144
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Agree to ToS required checkout problem
« Reply #4 on: February 03, 2013, 19:27:14 pm »
Just used this post, changed.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

remeedella

  • Jr. Member
  • **
  • Posts: 62
Re: Agree to ToS required checkout problem
« Reply #5 on: March 18, 2013, 20:51:28 pm »
awesomee!