1
0
Fork 0
mirror of synced 2025-04-06 07:13:33 +03:00

Fix create date

This commit is contained in:
dima-uryvskiy 2021-03-11 12:14:15 +03:00
parent adfc893c95
commit 33db0a6c83

View file

@ -56,15 +56,16 @@ class WC_Retailcrm_Order extends WC_Retailcrm_Abstracts_Data
$firstName = $order->get_shipping_first_name();
$lastName = $order->get_shipping_last_name();
if(empty($firstName) && empty($lastName))
{
if (empty($firstName) && empty($lastName)) {
$firstName = $order->get_billing_first_name();
$lastName = $order->get_billing_last_name();
}
$dateCreate = $order->get_date_created();
$data = array(
'externalId' => $order->get_id(),
'createdAt' => $order->get_date_created()->date('Y-m-d H:i:s'),
'createdAt' => !empty($dateCreate) ? $dateCreate->date('Y-m-d H:i:s') : date('Y-m-d H:i:s'),
'firstName' => $firstName,
'lastName' => $lastName,
'email' => strtolower($order->get_billing_email()),