diff --git a/woocommerce/single-product/add-to-cart/grouped.php b/woocommerce/single-product/add-to-cart/grouped.php index 711e28c..bbfb648 100755 --- a/woocommerce/single-product/add-to-cart/grouped.php +++ b/woocommerce/single-product/add-to-cart/grouped.php @@ -10,9 +10,9 @@ * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * - * @see https://docs.woocommerce.com/document/template-structure/ - * @package WooCommerce/Templates - * @version 4.0.0 + * @see https://docs.woocommerce.com/document/template-structure/ + * @package WooCommerce\Templates + * @version 4.8.0 */ defined( 'ABSPATH' ) || exit; @@ -36,6 +36,7 @@ ), $product ); + $show_add_to_cart_button = false; do_action( 'woocommerce_grouped_product_list_before', $grouped_product_columns, $quantites_required, $product ); @@ -45,7 +46,11 @@ $post = $post_object; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited setup_postdata( $post ); - echo ''; + if ( $grouped_product_child->is_in_stock() ) { + $show_add_to_cart_button = true; + } + + echo ''; // Output columns for each product. foreach ( $grouped_product_columns as $column_id ) { @@ -107,7 +112,7 @@ - + @@ -118,4 +123,4 @@ - + \ No newline at end of file