Controller for onepage checkouts
Definition at line 15 of file Action.php.
◆ __construct()
- Parameters
-
\Magento\Framework\App\Action\Context | $context | |
\Magento\Customer\Model\Session | $customerSession | |
CustomerRepositoryInterface | $customerRepository | |
AccountManagementInterface | $accountManagement | @codeCoverageIgnore |
Definition at line 39 of file Action.php.
45 $this->_customerSession = $customerSession;
48 parent::__construct($context);
◆ _preDispatchValidateCustomer()
_preDispatchValidateCustomer |
( |
|
$redirect = true , |
|
|
|
$addErrors = true |
|
) |
| |
|
protected |
Make sure customer is valid, if logged in
By default will add error messages and redirect to customer edit form
- Parameters
-
bool | $redirect | - stop dispatch and redirect? |
bool | $addErrors | - add error messages? |
- Returns
- bool|\Magento\Framework\Controller\Result\Redirect
Definition at line 60 of file Action.php.
63 $customer = $this->customerRepository->getById($this->_customerSession->getCustomerId());
64 }
catch (NoSuchEntityException $e) {
69 $validationResult = $this->accountManagement->validate(
$customer);
70 if (!$validationResult->isValid()) {
72 foreach ($validationResult->getMessages() as $error) {
73 $this->messageManager->addErrorMessage($error);
77 $this->_actionFlag->set(
'', self::FLAG_NO_DISPATCH,
true);
78 return $this->resultRedirectFactory->create()->setPath(
'customer/account/edit');
◆ $_customerSession
◆ $accountManagement
◆ $customerRepository
The documentation for this class was generated from the following file:
- vendor/magento/module-checkout/Controller/Action.php