Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AddressDataProcessorPlugin.php
Go to the documentation of this file.
1 <?php
7 
9 use Magento\Persistent\Helper\Session as PersistentSession;
10 use Magento\Persistent\Helper\Data as PersistentHelper;
13 
15 {
19  private $persistentSession;
20 
24  private $persistentHelper;
25 
29  private $checkoutSession;
30 
36  public function __construct(
37  PersistentHelper $persistentHelper,
38  PersistentSession $persistentSession,
39  CheckoutSession $checkoutSession
40  ) {
41  $this->persistentHelper = $persistentHelper;
42  $this->persistentSession = $persistentSession;
43  $this->checkoutSession = $checkoutSession;
44  }
45 
54  public function beforeProcess(AddressAdditionalDataProcessor $subject, AddressAdditionalData $additionalData)
55  {
56  if (!$this->persistentHelper->isEnabled() || !$this->persistentHelper->isRememberMeEnabled()) {
57  return;
58  }
59  $checkboxStatus = $additionalData->getExtensionAttributes()->getPersistentRememberMe();
60  $isRememberMeChecked = empty($checkboxStatus) ? false : true;
61  $this->persistentSession->setRememberMeChecked($isRememberMeChecked);
62  $this->checkoutSession->setRememberMeChecked($isRememberMeChecked);
63  }
64 }
return false
Definition: gallery.phtml:36
$persistentSession
Definition: persistent.php:11
beforeProcess(AddressAdditionalDataProcessor $subject, AddressAdditionalData $additionalData)
__construct(PersistentHelper $persistentHelper, PersistentSession $persistentSession, CheckoutSession $checkoutSession)