![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-persistent/Model/Plugin/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Persistent\Model\Plugin; class CustomerData { /** * Persistent data * * @var \Magento\Persistent\Helper\Data */ protected $persistentData; /** * Customer session * * @var \Magento\Customer\Model\Session */ protected $customerSession; /** * Persistent session * * @var \Magento\Persistent\Helper\Session */ protected $persistentSession; /** * CustomerData constructor. * * @param \Magento\Persistent\Helper\Data $persistentData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Persistent\Helper\Session $persistentSession */ public function __construct( \Magento\Persistent\Helper\Data $persistentData, \Magento\Customer\Model\Session $customerSession, \Magento\Persistent\Helper\Session $persistentSession ) { $this->persistentData = $persistentData; $this->customerSession = $customerSession; $this->persistentSession = $persistentSession; } /** * Reset quote reward point amount * * @param \Magento\Customer\CustomerData\Customer $subject * @param \Closure $proceed * * @return array * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function aroundGetSectionData( \Magento\Customer\CustomerData\Customer $subject, \Closure $proceed ) { /** unset customer first name */ if (!$this->customerSession->isLoggedIn() && $this->persistentData->isEnabled() && $this->persistentSession->isPersistent() ) { return []; } return $proceed(); } }