Merge pull request #11058 from slobodan/woocommerce_before_save_order_items
Introduce woocommerce_before_save_order_items hook
This commit is contained in:
commit
ced7a099f1
|
@ -179,6 +179,9 @@ function woocommerce_settings_get_option( $option_name, $default = '' ) {
|
||||||
* @param array $items Order items to save
|
* @param array $items Order items to save
|
||||||
*/
|
*/
|
||||||
function wc_save_order_items( $order_id, $items ) {
|
function wc_save_order_items( $order_id, $items ) {
|
||||||
|
// Allow other plugins to check change in order items before they are saved
|
||||||
|
do_action( 'woocommerce_before_save_order_items', $order_id, $items );
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
// Order items + fees
|
// Order items + fees
|
||||||
|
@ -374,6 +377,6 @@ function wc_save_order_items( $order_id, $items ) {
|
||||||
// Update version after saving
|
// Update version after saving
|
||||||
update_post_meta( $order_id, '_order_version', WC_VERSION );
|
update_post_meta( $order_id, '_order_version', WC_VERSION );
|
||||||
|
|
||||||
// inform other plugins that the items have been saved
|
// Inform other plugins that the items have been saved
|
||||||
do_action( 'woocommerce_saved_order_items', $order_id, $items );
|
do_action( 'woocommerce_saved_order_items', $order_id, $items );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue