mhatma Posted January 12, 2018 Share Posted January 12, 2018 Hi guys, We currently have some code that runs on AfterShoppingCartCheckout, so just before an order is added. We would like this same code to run when an admin creates an order in the admin panel. I can't see a hook available for this - the closest one is AcceptOrder but this doesn't fit what we need. Any ideas? Thanks! Link to comment Share on other sites More sharing options...
twhiting9275 Posted January 12, 2018 Share Posted January 12, 2018 Hmm, maybe instead of using AfterShoppingCartCheckout, you want to use AcceptOrder instead? I'm not sure of the scope of what you're adding, of course, but this would do what you need to do, once the order's actually accepted by admins, and yeah that would apply to admin orders, since like all , they have to be accepted? Link to comment Share on other sites More sharing options...
mhatma Posted January 15, 2018 Author Share Posted January 15, 2018 Hey, thanks for the reply. We have considered using AcceptOrder but I believe we need the code to fire whenever an order is added not necessarily accepted. Any ideas? Link to comment Share on other sites More sharing options...
twhiting9275 Posted January 16, 2018 Share Posted January 16, 2018 Without knowing what you're doing, we can only speculate really. if doing this after the order is accepted won't work, then you may want to use PendingOrder instead. However, this is going to be triggered before the checkout, or it should Alternatively, you could use some php magic and call AddInvoicePayment . However, you'll have to query the order table for that specific invoice, make sure that it should be doing what you're supposed to. AddInvoicePayment will trigger whether the admin creates the order or not, and PendingOrder should always trigger whan an order is 'Pending'. Link to comment Share on other sites More sharing options...
Recommended Posts