From 810a5eaf8bbb6233ccc5d1519296d76a70eeeaa2 Mon Sep 17 00:00:00 2001 From: Alexander Menk Date: Wed, 31 Oct 2012 17:53:12 +0100 Subject: [PATCH] Enable redirecting to continue checkout if customer data was incomplete --- app/code/core/Mage/Checkout/Controller/Action.php | 5 ++++- .../core/Mage/Customer/controllers/AccountController.php | 2 +- app/code/core/Mage/Customer/view/frontend/form/edit.phtml | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Checkout/Controller/Action.php b/app/code/core/Mage/Checkout/Controller/Action.php index 244a8f298c5fc..531a45c97e252 100644 --- a/app/code/core/Mage/Checkout/Controller/Action.php +++ b/app/code/core/Mage/Checkout/Controller/Action.php @@ -50,7 +50,10 @@ protected function _preDispatchValidateCustomer($redirect = true, $addErrors = t } } if ($redirect) { - $this->_redirect('customer/account/edit'); + $referer = Mage::getUrl('*/*/*', array('_current' => true, '_use_rewrite' => true)); + $referer = Mage::helper('core')->urlEncode($referer); + $arguments = array(Mage_Core_Controller_Varien_Action::PARAM_NAME_URL_ENCODED => $referer); + $this->_redirect('customer/account/edit', $arguments); $this->setFlag('', self::FLAG_NO_DISPATCH, true); } return false; diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php index 80ec456004e1c..6b8106eaecbc1 100644 --- a/app/code/core/Mage/Customer/controllers/AccountController.php +++ b/app/code/core/Mage/Customer/controllers/AccountController.php @@ -805,7 +805,7 @@ public function editPostAction() $this->_getSession()->setCustomer($customer) ->addSuccess($this->__('The account information has been saved.')); - $this->_redirect('customer/account'); + $this->_redirectSuccess('customer/account'); return; } catch (Mage_Core_Exception $e) { $this->_getSession()->setCustomerFormData($this->getRequest()->getPost()) diff --git a/app/code/core/Mage/Customer/view/frontend/form/edit.phtml b/app/code/core/Mage/Customer/view/frontend/form/edit.phtml index 5649e9eda57c1..ecb36b488766f 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/edit.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/edit.phtml @@ -30,6 +30,7 @@ getMessagesBlock()->getGroupedHtml() ?>
+ getBlockHtml('formkey')?>

__('Account Information') ?>