News:

Looking for documentation? Take a look on our wiki

Main Menu

terms of service message show show at the cart page

Started by rizecorp, September 25, 2013, 06:35:14 AM

Previous topic - Next topic

AH

Having problem with 2.0.25e

http://forum.virtuemart.net/index.php?topic=120781.msg412050#msg412050

The TOS message fires even though no customer tried to edit an address.
Regards
A

Joomla 3.10.11
php 8.0

CasperH

I found, that if I log in as a regular user instead of an admin, I don't have this message anymore. Has anyone tried that also?

Now, why admin has it, I am puzzled still.

Genius WebDesign

Just in case someone still needs to fix this issue, here is how I fixed it:

Modify this file:
/components/com_virtuemart/helpers/cart.php
at line 869 (v. 2.0.26d)

Original code:
if(empty($this->tosAccepted) and !empty($agreed->required) and $validUserDataBT!==-1){
$redirectMsg = null;// JText::_('COM_VIRTUEMART_CART_PLEASE_ACCEPT_TOS');
$this->tosAccepted = false;
vmInfo('COM_VIRTUEMART_CART_PLEASE_ACCEPT_TOS','COM_VIRTUEMART_CART_PLEASE_ACCEPT_TOS');
return $this->redirecter('index.php?option=com_virtuemart&view=cart' , $redirectMsg);
}


Modified code:
if(!empty($agreed->required) and $validUserDataBT!==-1){
$redirectMsg = null;// JText::_('COM_VIRTUEMART_CART_PLEASE_ACCEPT_TOS');
$this->tosAccepted = false;
vmInfo('COM_VIRTUEMART_CART_PLEASE_ACCEPT_TOS','COM_VIRTUEMART_CART_PLEASE_ACCEPT_TOS');
return $this->redirecter('index.php?option=com_virtuemart&view=cart' , $redirectMsg);
}


byPV

Hi all,

we solved this problem some time ago. Unfortunately there is a bad logic around the TOS. In example, I do not understand why data validation is performed when displaying cart. This should be done only when a customer clicks on Checkout or Confirm button. The message is displayed for that reason.

In version 2.0.26a some changes were made, but the problem can still occur in isolated cases.

This problem can be solved in several ways. One of them is:

Comment the line with the validation cart in the file /components/com_virtuemart/views/cart/view.html.php.

Before version 2.0.26a:


if (!$cart->_redirect and !VmConfig::get('use_as_catalog', 0)) {
  //$cart->checkout(false); // This Line
}


Since version 2.0.26a:


if (!$cart->_inCheckOut and !VmConfig::get('use_as_catalog', 0)) {
  //$cart->checkout(false); // This Line
}


Removing validation should not cause any problems. Validation is also done correctly when Checkout or Confirm button is clicked.

We tested it on version 2.0.22c and 2.0.26d.