Open Last Ticket that was close but haven't been paid yet

Hello, So I been working with pre-orders and as I just realized pre-orders do not update the inventory, I manage to get the inventory right by setting ticket to preorder false before closing them when they get paid for the total amount.

The problem about this is that the inventory will just be updated after the ticket have been closed and paid. I would like the inventory to be update in real time (after the order is been submitted) but keep the ticket as pre order until it gets closed and paid.

I believe I could solve this by changing the ticket to preorder false just before adding new orders to the ticket and later change it back to pre order just after the inventory has been updated. For this to work I have set up the program as follow:

All the tickets are created as pre orders, so first I would have to set the ticket as pre order false in the ‘order added to ticket’ rule, so from here the ticket will be a real ticket and the inventory will be updated in real time:

After that I want to change the ticket again to pre order but only after inventory has been updated, so for this to work I have to close the ticket (now a real ticket) and open it again and just then set it as pre order, For this I have set up the following rule:

The problem is that I’m not been able to open the ticket that was just close, I follow some tutorial but just can’t get it to work. If I get this to work then I just have to set the ticket as pre order again and that will do it.
I have set up the following actions for this:

Thanks you in advance for any help you could give me on this topic!

You have a program setting without a name and are calling with wrong tag.

Specify a program setting name like lastTicket.
Then to get that setting value back use {SETTING:lastTicket}.

On a seperate note you might struggle to do this on an automation command…
If the ticket is NEW, and not been submitted before the ticket will not have an ID untill ‘before ticket close’ event. Which would obviously be after automation command.

You should however be able to move that update setting to a before ticket closing rule.

1 Like

Thanks a lot, I got it to work but I realize now that when a ticket is set to pre order any item that is inside of it won’t be taking into account for inventory, so whenever it is set back to pre order it will take the products out of the inventory records. I think I will have to live with it, thanks anyway!

I tried using preorder, did my head in.
Did we not discuss using accounts rather than preorder?
Using accounts would treat all tickets as normal and would have no issues with inventory…

Yes but I have managed to get everything I needed with pre orders, just some little things are not working perfectly, I will work with pre orders for now since i need it to get it done soon but for sure will come back to set it up as accounts later.

1 Like

That’s fair enough, can confidently say when you get the time you will convert :smile:

1 Like

It’s funny how so many people try to use pre orders for everything BUT preorders lol.