fix: sync shopify customer addresses (#25481)
This commit is contained in:
parent
9226cd3932
commit
6e179c3092
@ -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({
|
||||||
|
Loading…
Reference in New Issue
Block a user