Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'd like to do a final check of stock levels before the customer makes the purchase in TC v3.
On my final page I'm using TC.GeneratePaymentForm so the next click will complete the booking.
What the best way to use the .Net API to check the stock at the last possible stage and inform the customer if something needs to be changed before a product is purchased?
Is there an event I should be using perhaps? BeforeOrderFinalized?
Hmm, I'm not sure there is a BeforeOrderFinalized event.
If they aren't, then display an error, but if they are, allow the button to complete. That could be one approach.
There used to be events AfterOrderFinalized & BeforeOrderFinalized in TeaCommerce.Data.Extensibility in previous versions of TC but I can't find them in version 3.
They were pretty useful events to hook into so what do we do now in v3 if we need to process something before or after an order has taken place?
There is a Order.Finalized event that occurs after an order is finalized, but there isn't current one that fires before. The best there would be would be Order.Updating event, though that wouldn't really know if it's about to be finalized.
I'll have a look back through the commit logs to see if there was a reason for not having a Finalizing event incase there was a reason, but unfortunately there isn't one currently.
Ok, thanks Matt.
Could I use the new Finalizing event in v 3.3.0?
It doesn't appear to be documented yet?
Sorry, I totally forgot to come back to this.
Yes you could, however we don't have a means of canceling an event yet so you could use it to check the stock level, but the transaction would still go through.
I still need to look into what it would take to make them cancel-able.
I'll hold off upgrading for now then.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted