Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • MOthman 27 posts 89 karma points
    Nov 17, 2017 @ 12:08
    MOthman
    0

    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

    SaveToAddress(IAddress toAddress, AddressType addressType, string addressKey = "")
    

    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.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.

Please Sign in or register to post replies

Write your reply to:

Draft