Merge pull request #22997 from woocommerce/fix/22992
Add stock to search results manually
This commit is contained in:
commit
47135c6a68
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue