Last active
August 29, 2015 14:25
-
-
Save Yame-/0365646952da00ae5e7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function catch_new_order($orderid){ | |
// Check for new order | |
// Set a scheduled event after 10min to check if order has been succesfully proccesed. | |
// If not, send SMS with orderID and name of client. | |
// 1: We are setting the time of the event after 10 minutes. | |
// 2: We provide an action to be called if the event is run. | |
// 3: We provide additional parameters to got with the action. In this case our order id. | |
wp_schedule_single_event( time() + 600, 'send_sms_if_order_failed', array( $orderid ) ); | |
} | |
add_action( 'woocommerce_new_order', 'catch_new_order', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment