Out of stock should not show qty in grouped products.

This commit is contained in:
Mike Jolley 2017-12-15 15:32:50 +00:00
parent d90b817598
commit 06a7570f4b
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
case 'quantity' :
ob_start();
if ( ! $grouped_product->is_purchasable() || $grouped_product->has_options() ) {
if ( ! $grouped_product->is_purchasable() || $grouped_product->has_options() || ! $grouped_product->is_in_stock() ) {
woocommerce_template_loop_add_to_cart();
} elseif ( $grouped_product->is_sold_individually() ) {
echo '<input type="checkbox" name="' . esc_attr( 'quantity[' . $grouped_product->get_id() . ']' ) . '" value="1" class="wc-grouped-product-add-to-cart-checkbox" />';