Skip to content

Commit 1cae605

Browse files
committed
Set shipping and billing address when loading a customer in order creation
In the order creation, when customer details view is opened: 1. We make a call to wc-analytics/customers to fetch customers who made past orders 2. WCAnalyticsCustomer is mapped to Storage.Customer, however, we don't map all the available data in the WCAnalyticsCustomer, making shipping details get lost
1 parent 9d7f634 commit 1cae605

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Modules/Sources/Yosemite/Model/Storage/Customer+ReadOnlyConvertible.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,18 @@ extension Storage.Customer: ReadOnlyConvertible {
8080
shippingFirstName = firstName
8181
shippingLastName = lastName
8282
shippingEmail = email
83+
shippingCity = customer.city
84+
shippingState = customer.region
85+
shippingPostcode = customer.postcode
86+
shippingCountry = customer.country
8387

8488
billingFirstName = firstName
8589
billingLastName = lastName
8690
billingEmail = email
91+
billingCity = customer.city
92+
billingState = customer.region
93+
billingPostcode = customer.postcode
94+
billingCountry = customer.country
8795
}
8896

8997
/// Returns a ReadOnly (`Networking.Customer`) version of the `Storage.Customer`

0 commit comments

Comments
 (0)