[#16242] Add context to woocommerce_backordered_item_meta_name
This commit is contained in:
parent
c9d500f4db
commit
7781b2ea4d
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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'] ) );
|
||||
|
|
Loading…
Reference in New Issue