Merge pull request #18194 from woocommerce/fix/18179

Out of stock should not show qty in grouped products.
This commit is contained in:
Claudiu Lodromanean 2017-12-15 08:38:32 -08:00 committed by GitHub
commit f89eab057b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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" />';