I'm working on a website where a company distributors may purchase products on behalf of their customers. If a distributor is purchasing they will need to enter extra details for their customer (who wishes to use the product).
Thus, the checkout steps are now: Billing address, Customer Details, Shipping address, etc.
I managed easily to show CustomerDetails Form and save entries to the extended data as AddressType.Custom. However, I still need to save the customer details in the database as an associated address to the distributor and retrieve it when needed - as in the SalesOverview page in the backoffice, or on the receipt page.
For now to save the customer address to ExtendedData I had to edit BasketCheckoutCustomerManager.cs adding the method
the method is more flexible than SaveShipToAddress and SaveBillToAddress as it allows adding any address type with custom key too. This also means I had to edit Extension.ExtendedDataCollectionAddAddress method to take [string addressKey = ""] parameter.
And now, the customer form gets populated with any pre-entered customer data, but I still can't retrieve such data in the receipt page or the _address partial page too - unless I fight with many internals.
What is the best practice to do so without missing up the core code.
Custom checkout address stage
I'm working on a website where a company distributors may purchase products on behalf of their customers. If a distributor is purchasing they will need to enter extra details for their customer (who wishes to use the product).
Thus, the checkout steps are now: Billing address, Customer Details, Shipping address, etc.
I managed easily to show CustomerDetails Form and save entries to the extended data as AddressType.Custom. However, I still need to save the customer details in the database as an associated address to the distributor and retrieve it when needed - as in the SalesOverview page in the backoffice, or on the receipt page.
For now to save the customer address to ExtendedData I had to edit BasketCheckoutCustomerManager.cs adding the method
the method is more flexible than
SaveShipToAddress
andSaveBillToAddress
as it allows adding any address type with custom key too. This also means I had to editExtension.ExtendedDataCollection
AddAddress
method to take[string addressKey = ""]
parameter.And now, the customer form gets populated with any pre-entered customer data, but I still can't retrieve such data in the receipt page or the _address partial page too - unless I fight with many internals.
What is the best practice to do so without missing up the core code.
is working on a reply...