wpc_order_updated
The WooCommerce Putler Connector wpc order updated function.
Description
wpc_order_updated( $post_id );
Parameters (1)
- 0. $post_id
- The post id.
Usage
if ( !function_exists( 'wpc_order_updated' ) ) { require_once ABSPATH . PLUGINDIR . 'woocommerce-putler-connector/woocommerce-putler-connector.php'; } // The post id. $post_id = null; // NOTICE! Understand what this does before running. $result = wpc_order_updated($post_id);
Defined (1)
The function is defined in the following location(s).
- /woocommerce-putler-connector.php
- function wpc_order_updated( $post_id ) {
- //Flag for woo2.2+
- $order_status_new = $_POST['order_status'];
- if (version_compare ( WOOCOMMERCE_VERSION, '2.2.0', '<' )) {
- $order_status_old = get_the_terms( $post_id, 'shop_order_status');
- $order_status_old = $order_status_old[0]->slug;
- } else {
- $order_status_old = get_post_status( $post_id );
- if( $order_status_new == 'wc-refunded' ) {
- return;
- }
- }
- if ( get_post_type( $post_id ) === 'shop_order' && $order_status_old == $order_status_new ) {
- wpc_post_order($post_id);
- }
- }