Class EmulateQuote
Definition at line 14 of file EmulateQuoteObserver.php.
◆ __construct()
- Parameters
-
\Magento\Persistent\Helper\Session | $persistentSession | |
\Magento\Persistent\Helper\Data | $persistentData | |
\Magento\Checkout\Model\Session | $checkoutSession | |
\Magento\Customer\Model\Session | $customerSession | |
\Magento\Customer\Api\CustomerRepositoryInterface | $customerRepository | |
Definition at line 58 of file EmulateQuoteObserver.php.
66 $this->_persistentData = $persistentData;
67 $this->_checkoutSession = $checkoutSession;
68 $this->_customerSession = $customerSession;
◆ execute()
Emulate quote by persistent data
- Parameters
-
\Magento\Framework\Event\Observer | $observer | |
- Returns
- void
Definition at line 78 of file EmulateQuoteObserver.php.
80 $stopActions = [
'persistent_index_saveMethod',
'customer_account_createpost'];
82 if (!$this->_persistentData->canProcess(
$observer)
83 || !$this->_persistentSession->isPersistent()
84 || $this->_customerSession->isLoggedIn()
89 $actionName =
$observer->getEvent()->getRequest()->getFullActionName();
91 if (in_array($actionName, $stopActions)) {
95 if ($this->_persistentData->isShoppingCartPersist()) {
96 $this->_checkoutSession->setCustomerData(
97 $this->customerRepository->getById($this->_persistentSession->getSession()->getCustomerId())
99 if (!$this->_checkoutSession->hasQuote()) {
100 $this->_checkoutSession->getQuote();
◆ $_checkoutSession
◆ $_customerSession
◆ $_persistentData
◆ $_persistentSession
$_persistentSession = null |
|
protected |
◆ $customerRepository
The documentation for this class was generated from the following file: