Error when order get_date_paid() is null
-
Hi,
The following error has occurredAn error of type E_ERROR was caused in line 6441 of the file /home/nginx/domains/domain.com/public/wp-content/plugins/eas-eu-compliance/EAScompliance.php. Error message: Uncaught TypeError: date_format(): Argument #1 ($object) must be of type DateTimeInterface, null given in /home/nginx/domains/domain.com/public/wp-content/plugins/eas-eu-compliance/EAScompliance.php:6441The code responsible is
'sale_date'=>date_format($order->get_date_paid(), 'Y-m-d\TH:i:sP'),It looks like the order has no paid date, since it was cancelled before getting paid, which makes “$order->get_date_paid()” null, and date_format throws an error.
Can you please have a look?
The topic ‘Error when order get_date_paid() is null’ is closed to new replies.