From 7781b2ea4db8c37e7092fb61a09974e2fbe3619b Mon Sep 17 00:00:00 2001 From: Fulvio Notarstefano Date: Tue, 25 Jul 2017 11:54:03 +0800 Subject: [PATCH] [#16242] Add context to woocommerce_backordered_item_meta_name --- includes/class-wc-order-item-product.php | 2 +- includes/legacy/abstract-wc-legacy-order.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-order-item-product.php b/includes/class-wc-order-item-product.php index 2cf90dfb801..0e15e277c46 100644 --- a/includes/class-wc-order-item-product.php +++ b/includes/class-wc-order-item-product.php @@ -198,7 +198,7 @@ class WC_Order_Item_Product extends WC_Order_Item { public function set_backorder_meta() { $product = $this->get_product(); if ( $product && $product->backorders_require_notification() && $product->is_on_backorder( $this->get_quantity() ) ) { - $this->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $this->get_quantity() - max( 0, $product->get_stock_quantity() ), true ); + $this->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ), $this ), $this->get_quantity() - max( 0, $product->get_stock_quantity() ), true ); } } diff --git a/includes/legacy/abstract-wc-legacy-order.php b/includes/legacy/abstract-wc-legacy-order.php index 976013e120e..30faea7c8af 100644 --- a/includes/legacy/abstract-wc-legacy-order.php +++ b/includes/legacy/abstract-wc-legacy-order.php @@ -161,7 +161,7 @@ abstract class WC_Abstract_Legacy_Order extends WC_Data { // Handle qty if set. if ( isset( $args['qty'] ) ) { if ( $product->backorders_require_notification() && $product->is_on_backorder( $args['qty'] ) ) { - $item->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ) ), $args['qty'] - max( 0, $product->get_stock_quantity() ), true ); + $item->add_meta_data( apply_filters( 'woocommerce_backordered_item_meta_name', __( 'Backordered', 'woocommerce' ), $item ), $args['qty'] - max( 0, $product->get_stock_quantity() ), true ); } $args['subtotal'] = $args['subtotal'] ? $args['subtotal'] : wc_get_price_excluding_tax( $product, array( 'qty' => $args['qty'] ) ); $args['total'] = $args['total'] ? $args['total'] : wc_get_price_excluding_tax( $product, array( 'qty' => $args['qty'] ) );