Skip to content

Commit

Permalink
add new param phone number to orders (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
kadukia123 authored Jan 21, 2025
1 parent 981e2b5 commit cf5f1c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/code/Fera/Ai/Observer/Frontend/OrderPushEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ public function execute(Observer $observer) {
];

if (!empty($order->getShippingAddress())) { $orderData['shipping_address'] = $this->getShippingData($order); }
if (!empty($order->getBillingAddress())) { $orderData['shipping_address'] = $this->getBillingData($order); }
if (!empty($order->getBillingAddress())) {
$orderData['shipping_address'] = $this->getBillingData($order);
$orderData['phone_number'] = $order->getBillingAddress()->getTelephone();
}

$this->pushOrders($orderData);

Expand All @@ -120,6 +123,7 @@ public function getCustomerData($order) {
'external_id' => $customerId,
'name' => $customerName,
'email' => $order->getCustomerEmail(),
'phone_number' => $order->getBillingAddress()->getTelephone(),
];

return $customer;
Expand Down

0 comments on commit cf5f1c9

Please sign in to comment.