Don't format stock if empty

This commit is contained in:
Mike Jolley 2016-01-28 11:31:53 +00:00
parent 67521b7475
commit 3b43a53546
1 changed files with 1 additions and 1 deletions

View File

@ -2535,7 +2535,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'] );
$variation_data['_stock'] = '' === $variation_data['_stock'] ? '' : wc_stock_amount( $variation_data['_stock'] );
include( 'admin/meta-boxes/views/html-variation-admin.php' );