Last active
July 12, 2018 19:04
-
-
Save williankeller/4cbc5bda169d78f7b447dae201d15ad1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Account { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function isCustomerBlocked($return = false) | |
| { | |
| if ($this->helper->isBlockedActive() && $this->customerSession->getIsCustomerBlocked() == 1) { | |
| // Close session to recreate the login. | |
| $this->customerSession->logout(); | |
| $this->customerSession->start(); | |
| $this->messageManager->addError($this->helper->blockedMessage()); | |
| $url = $this->helper->blockedRedirect(); | |
| $redirect = $this->url->getUrl($url); | |
| $response = $this->response->setRedirect($redirect)->sendResponse(); | |
| // Stop process. | |
| if ($return) { | |
| return $response; | |
| } | |
| exit; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment