fix: sync shopify customer addresses (#25481)

This commit is contained in:
Ankush Menat 2021-05-10 13:24:26 +05:30 committed by GitHub
parent 9226cd3932
commit 6e179c3092
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,10 +32,12 @@ def create_customer(shopify_customer, shopify_settings):
raise e raise e
def create_customer_address(customer, shopify_customer): def create_customer_address(customer, shopify_customer):
if not shopify_customer.get("addresses"): addresses = shopify_customer.get("addresses", [])
return
for i, address in enumerate(shopify_customer.get("addresses")): if not addresses and "default_address" in shopify_customer:
addresses.append(shopify_customer["default_address"])
for i, address in enumerate(addresses):
address_title, address_type = get_address_title_and_type(customer.customer_name, i) address_title, address_type = get_address_title_and_type(customer.customer_name, i)
try : try :
frappe.get_doc({ frappe.get_doc({