From 5b1814016bade68c9819f6c04d54dbb2166ae73b Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Tue, 12 Mar 2019 14:48:05 +0000 Subject: [PATCH] Add stock with different function --- includes/class-wc-ajax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 8b35693be65..a9c123c22bd 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -1562,7 +1562,9 @@ class WC_AJAX { $managing_stock = $product_object->managing_stock(); if ( $managing_stock && ! empty( $_GET['display_stock'] ) ) { - $formatted_name .= ' – ' . wc_format_stock_for_display( $product_object ); + $stock_amount = $product_object->get_stock_quantity(); + /* Translators: %d stock amount */ + $formatted_name .= ' – ' . sprintf( __( 'Stock: %d', 'woocommerce' ), wc_format_stock_quantity_for_display( $stock_amount, $product_object ) ); } $products[ $product_object->get_id() ] = rawurldecode( $formatted_name );