VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: gba on November 14, 2019, 17:27:31 PM

Title: How to return to cart after Register
Post by: gba on November 14, 2019, 17:27:31 PM
Hello!

Joomla!3.9.13
VM v3.6.8.10202

I added a link for Register to my cart layout override.
After finishing Register, I want the user to land in the cart again automatically.
How can I achieve that?

Thank you for any useful hint!

Kind regards,
Gerald
Title: Re: How to return to cart after Register
Post by: GJC Web Design on November 14, 2019, 22:22:35 PM
In the standard install they do.. 

and there is a register link in the cart anyway -> Add/Edit Billing details so not sure what your asking

after reg in the user controller there is:

function saveUser(){

if (!class_exists('VirtueMartCart')) require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php');
$cart = VirtueMartCart::getCart();

$layout = vRequest::getCmd('layout','edit');

if($cart->_fromCart or $cart->getInCheckOut()){

$msg = $this->saveData($cart);
$task = '';
vmdebug('saveUser _fromCart',(int)$cart->_fromCart,(int)$msg);
if(!$msg){
$this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT'.$task, FALSE) );
} else {
if ($cart->getInCheckOut()){
$task = '&task=checkout';

}
$this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=cart'.$task, FALSE) );
}
} else {
$msg = $this->saveData(false);
$this->setRedirect( JRoute::_('index.php?option=com_virtuemart&view=user&layout='.$layout, FALSE) );
}

}


Title: Re: How to return to cart after Register
Post by: gba on December 12, 2019, 11:32:07 AM
Thank you!