Estou tendo o seguinte erro:
Uncaught Error: Call to undefined method Magento\Payment\Gateway\Data\Order\OrderAdapter::getCustomerIsGuest() in /home/extre146/public_html/atividades/app/code/Picpay/Payment/Helper/Data.php:593
Abaixo seguem as linhas 593 - 599:
if(!$order->getCustomerIsGuest()){
$customerId = $order->getCustomerId();
$customer = $this->customerRepositoryInterface->getById($customerId);
if ($customer && $customer->getId()) {
$taxvat = $customer->getTaxvat();
}
}
With file "Magento\Payment\Gateway\Data\Order\OrderAdapter" function "getCustomerIsGuest()" does not exist with in file.
File path as below:
/vendor/magento/module-payment/Gateway/Data/Order/OrderAdapter.php
For get customer is guest or not please use follow code:
$order = $this->_objectManager->create('\Magento\Sales\Model\Order')->load($id); $id = $order->getCustomerId(); if(!$order->getCustomerIsGuest()){ $customerId = $order->getCustomerId(); $customer = $this->customerRepositoryInterface->getById($customerId); if ($customer && $customer->getId()) { $taxvat = $customer->getTaxvat(); } }