Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Address Management In Commerce (Commerce 11.2.6)

Vote:
 

Hi guys, I've been digging through the commerce training material and quicksilver trying to find out how address management work with carts.

I've basically got a address passed in the checkout from from the user and either 2 address one for deliery and one for billing, one for both and the ability to set one set in the customer profile. All of this I can see in commerce manager but in the docs and the example I can't seem to find anything to set a carts separte addresses all I can see is IShipment and IOrderAddress. 

Can anyone tell me if I was provided with 2 addresses with a set of fields from the front end during the checkout process how I can

a. Save these separete billing and delivery addresses to the cart/shipment without saving to the user profile

b. Save one of these to the user profile for later use?

Thanks,

Scott

#186259
Edited, Dec 14, 2017 18:33
Vote:
 

a. For the delivery address you have to create an IOrderAddress and save it to the IShipment.ShippingAddress. For the billing address you have to create it and save it to IOrderForm.Payments[].BillingAddress. The new APIs doesn't allow you to get/set these directly on the IOrderForm so unless you want to cast them to the old classes you have to create shipments and payments before you create the addresses.

b. Nothing new here, everything is the same old BusinessFoundation. You have to create an CustomerAddress and save it to the CustomerContact.

#186290
Dec 15, 2017 15:10
Vote:
 

Great thanks for the advice Erik, I was really struggling to find examples of this simple process (mostly the billing process) so this points me in the right direction :-) Will Mark as answer once I've had a play

#186291
Edited, Dec 15, 2017 15:13
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.