Don't format stock if empty
This commit is contained in:
parent
67521b7475
commit
3b43a53546
|
@ -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' );
|
||||
|
||||
|
|
Loading…
Reference in New Issue