From 43c24feffdb7fb35c59f4c174c5999d4069be80c Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 11 Feb 2015 22:14:24 +0000 Subject: [PATCH] Item meta removal query in order class. --- includes/abstracts/abstract-wc-order.php | 2 +- readme.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/abstracts/abstract-wc-order.php b/includes/abstracts/abstract-wc-order.php index 2ada4616c8c..91e9734445e 100644 --- a/includes/abstracts/abstract-wc-order.php +++ b/includes/abstracts/abstract-wc-order.php @@ -141,7 +141,7 @@ abstract class WC_Abstract_Order { $wpdb->query( $wpdb->prepare( "DELETE FROM itemmeta USING {$wpdb->prefix}woocommerce_order_itemmeta itemmeta INNER JOIN {$wpdb->prefix}woocommerce_order_items items WHERE itemmeta.order_item_id = items.order_item_id AND items.order_id = %d AND items.order_item_type = %s", $this->id, $type ) ); $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d AND order_item_type = %s", $this->id, $type ) ); } else { - $wpdb->query( $wpdb->prepare( "DELETE FROM itemmeta USING {$wpdb->prefix}woocommerce_order_itemmeta itemmeta INNER JOIN {$wpdb->prefix}woocommerce_order_items items WHERE itemmeta.order_item_id = items.order_item_id and items.order_id = %d )", $this->id ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM itemmeta USING {$wpdb->prefix}woocommerce_order_itemmeta itemmeta INNER JOIN {$wpdb->prefix}woocommerce_order_items items WHERE itemmeta.order_item_id = items.order_item_id and items.order_id = %d", $this->id ) ); $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_order_items WHERE order_id = %d", $this->id ) ); } } diff --git a/readme.txt b/readme.txt index c18385e492c..5abab6334fc 100644 --- a/readme.txt +++ b/readme.txt @@ -138,6 +138,8 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc == Changelog == +* Fix - Item meta removal query in order class. + = 2.3.1 - 11/02/2015 = * Fix - When the geolocation database cannot download, ensure the correct method is used to log the error. * Fix - Notice in woocommerce_form_field().