43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Stemcell\Customer\CustomerData;
|
|
|
|
use Magento\Customer\Helper\Session\CurrentCustomer;
|
|
use Magento\Customer\Helper\View;
|
|
use Magento\Framework\App\ObjectManager;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
class Customer extends \Magento\Customer\CustomerData\Customer
|
|
{
|
|
protected View $customerViewHelper;
|
|
|
|
/**
|
|
* @param CurrentCustomer $currentCustomer
|
|
* @param View $customerViewHelper
|
|
*/
|
|
public function __construct(
|
|
CurrentCustomer $currentCustomer,
|
|
View $customerViewHelper
|
|
) {
|
|
$this->currentCustomer = $currentCustomer;
|
|
$this->customerViewHelper = $customerViewHelper;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getSectionData()
|
|
{
|
|
if (!$this->currentCustomer->getCustomerId()) {
|
|
return [];
|
|
}
|
|
|
|
$customer = $this->currentCustomer->getCustomer();
|
|
return [
|
|
'fullname' => $this->customerViewHelper->getCustomerName($customer),
|
|
'firstname' => $customer->getId(),
|
|
'websiteId' => $customer->getWebsiteId(),
|
|
];
|
|
}
|
|
}
|