I have another API inside plugin for making another order in a website so I want when the customer cancel the woocommerce order I've to canel also the other website order, I'll have the order id of woocommerce and the order id of the other website in wp_post_meta
I just want to know how to get the order id that customer canceled to call the order id and the other one to cancel both
function cancel_SP_order(){
// how to get the order id cancelation with the hook
get_post_meta() ..... // for example
// I get $order_id from wp_post_meta which has the other order id
// I cancel the other
}
add_action('woocommerce_cancelled_order','cancel_SP_order');
if there's a better way for sure I welcome