Merge branch 'master' of github.com:woothemes/woocommerce

This commit is contained in:
Claudio Sanches 2014-12-23 14:12:22 -02:00
commit 5ce07351a1
1 changed files with 6 additions and 1 deletions

View File

@ -2309,7 +2309,12 @@ abstract class WC_Abstract_Order {
$qty = apply_filters( 'woocommerce_order_item_quantity', $item['qty'], $this, $item ); $qty = apply_filters( 'woocommerce_order_item_quantity', $item['qty'], $this, $item );
$new_stock = $_product->reduce_stock( $qty ); $new_stock = $_product->reduce_stock( $qty );
$this->add_order_note( sprintf( __( 'Item #%s stock reduced from %s to %s.', 'woocommerce' ), $item['product_id'], $new_stock + $qty, $new_stock) ); if ( isset( $item['variation_id'] ) && $item['variation_id'] ) {
$this->add_order_note( sprintf( __( 'Item\'s #%s variation #%s stock reduced from %s to %s.', 'woocommerce' ), $item['product_id'], $item['variation_id'], $new_stock + $qty, $new_stock) );
} else {
$this->add_order_note( sprintf( __( 'Item #%s stock reduced from %s to %s.', 'woocommerce' ), $item['product_id'], $new_stock + $qty, $new_stock) );
}
$this->send_stock_notifications( $_product, $new_stock, $item['qty'] ); $this->send_stock_notifications( $_product, $new_stock, $item['qty'] );
} }