Skip to content

Commit

Permalink
geting customerAddress from shipping lines instead of billingaddress (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorrgg authored Oct 10, 2024
1 parent d67a803 commit 9a477b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions functions/lib/integration/exports/orders-to-horus.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ module.exports = async ({ appSdk, storeId, auth }, orderId, opts = {}) => {
const shippingLine = order.shipping_lines && order.shipping_lines.length && order.shipping_lines[0]
const shippingApp = shippingLine && shippingLine.app

const isBillingAddress = transaction?.billing_address?.zip
const customerAddress = isBillingAddress
? transaction?.billing_address
: shippingLine?.to
const isShippingAddress = shippingLine?.to?.zip
const customerAddress = isShippingAddress
? shippingLine?.to
: transaction?.billing_address

if (!order.financial_status) {
console.log(`${logHead} skipped with no financial status`)
Expand Down

1 comment on commit 9a477b4

@leomp12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops

Please sign in to comment.