Skip to content

Commit

Permalink
fix: shopify default customer
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r committed Oct 5, 2023
1 parent f7100d2 commit 0dd684b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ecommerce_integrations/shopify/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ def create_order(order, setting, company=None):


def create_sales_order(shopify_order, setting, company=None):
customer = frappe.db.get_value(
"Customer", {CUSTOMER_ID_FIELD: shopify_order.get("customer", {}).get("id")}, "name",
)
customer = None
if customer_id := shopify_order.get("customer", {}).get("id"):
customer = frappe.db.get_value("Customer", {CUSTOMER_ID_FIELD: customer_id}, "name")

so = frappe.db.get_value("Sales Order", {ORDER_ID_FIELD: shopify_order.get("id")}, "name")

if not so:
Expand Down

0 comments on commit 0dd684b

Please sign in to comment.