From b50a75ce23bc77111c28a8fbfaa10c9f673f8a32 Mon Sep 17 00:00:00 2001 From: Florian Ludwig Date: Fri, 28 Aug 2015 18:17:54 +0200 Subject: [PATCH] Use wc_stock_amount for ajax response in variation admin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit My previous pull request of old WC 2.3 didn’t get applied in the new 2.4 AJAX method for the variation admin. So let’s do it again ;) (old pull request see #8304) --- includes/class-wc-ajax.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index f1cd58c61b5..151e16e6a15 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -805,6 +805,7 @@ class WC_AJAX { $variation_data['image'] = $variation_data['_thumbnail_id'] ? wp_get_attachment_thumb_url( $variation_data['_thumbnail_id'] ) : ''; $variation_data['shipping_class'] = $shipping_classes && ! is_wp_error( $shipping_classes ) ? current( $shipping_classes )->term_id : ''; $variation_data['menu_order'] = $variation->menu_order; + $variation_data['_stock'] = wc_stock_amount( $variation_data['_stock'] ); // Get tax classes $tax_classes = WC_Tax::get_tax_classes();