cancel
Showing results for 
Search instead for 
Did you mean: 

Uncaught Error: Call to undefined method

Uncaught Error: Call to undefined method

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();
}

1 REPLY 1

Re: Uncaught Error: Call to undefined method

Hi @mauriciofe9603 

 

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();
	}
}

 

Problem solved? Click Accept as Solution!