Copied to clipboard

Flag this post as spam?

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


  • NPina 32 posts 183 karma points
    Sep 01, 2022 @ 17:46
    NPina
    0

    Vendr Checkout

    How can I associate logged In user to ordersLines before got to checkout page.

    Thanks

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Sep 02, 2022 @ 07:43
    Matt Brailsford
    100

    Hey,

    You can call order.AssignToCustomer(member.Key.ToString()) to manually assign the order to a customer before Vendr does at the review stage.

    Hope this helps

    Matt

  • NPina 32 posts 183 karma points
    Sep 02, 2022 @ 11:33
    NPina
    0

    The best support ever, Thank you for your quick answer.

    I'm current get order by var order = VendrApi.Instance.GetCurrentOrder(content.GetStore().Id);

    Now I'm doing order.AssignToCustomer(member.Key.ToString()) and getting an error because order is type of OrderReadOnly.

    Thanks

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Sep 02, 2022 @ 12:51
    Matt Brailsford
    100

    Sorry, I just gave you the key part of the API, but you'll need to convert the read only entity to a writable one first.

    You can find out how by following the docs here https://vendr.net/docs/core/2.1.0/umbraco-v9/key-concepts/readonly-and-writable-entities/#converting-a-readonly-entity-into-a-writable-entity

    Hope this helps

  • NPina 32 posts 183 karma points
    Sep 02, 2022 @ 17:03
    NPina
    0

    Hi Matt,

    Thank you for the support. It help me a lot.

Please Sign in or register to post replies

Write your reply to:

Draft