Copied to clipboard

Flag this post as spam?

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


  • Philip Hayton 98 posts 435 karma points
    Nov 16, 2022 @ 14:03
    Philip Hayton
    0

    Help with implementing edit order

    Hi Matt,

    I've started looking into adding edit order functionality and I just want to get your opinion / ask a couple of questions. I know Vendr doesn't suppor this out the box so I am trying to keep it simple and avoid going too far off-piste.

    What if the value of an order changes?

    We are not concerning ourselves with refunds or partial payments. If the value of an order changes the store manager will issue a refund / partial payment manually outside of Vendr.

    We'll probably just use the ActivityLog to keep a paper trail within Vendr.

    Getting the order to an 'editable' state

    The cart view offers exactly the functionality we're looking for so the question is what's the best way to get an existing order into that view.

    I am thinking we can either:

    • A) 'unfinalize' an existing order,
    • B) clone the existing order to a new cart and soft delete the finalized one
    • C) duplicate the cart view functionality in a new view that works with finalized orders

    (A) would be ideal but I don't think that's possible? Therefore (B) is probably my best bet. I'm just wondering if there is a built in method for cloning an order to a new cart? I did see the Order.CopiedFromOrderId property but wasn't sure what this is for / how it's used.

    Reverting an order back to a 'finalized' state

    I'll need to add a button to let administrators finalize an order from the cart screen (if it has been cloned from another order).

    The Order.Finalize() method which look like it'll do the trick, but since there is no new transaction taking is it possible to just copy the transaction info from the old order?

    Any other thoughts?

    Can you think of anything else that could be a potential banana skin? Or do you have any other thoughts that might make things easier?

    Sorry, I know this is a bit of a long winded one, but any help is greatly appreciated 🙏🏻

    TIA

    Phil

  • Philip Hayton 98 posts 435 karma points
    Dec 01, 2022 @ 15:41
    Philip Hayton
    0

    Hi Matt,

    Don't worry about my previous message I think I've plotted a decent path forward. I'll just use this thread to ask a few specific questions as I'm working.

    The first one is: other than writing raw SQL, is there any way to set the value of Order.CopiedFromOrderId field?

    Cheers

    Phil

Please Sign in or register to post replies

Write your reply to:

Draft