From 2f39d0a6fb2c8c2934524485f5e1b9a7d012e852 Mon Sep 17 00:00:00 2001 From: Jory Hogeveen Date: Thu, 21 Nov 2019 13:28:43 +0100 Subject: [PATCH 1/2] Before and after product list hooks Allows adding extra rows. --- templates/single-product/add-to-cart/grouped.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/single-product/add-to-cart/grouped.php b/templates/single-product/add-to-cart/grouped.php index 621873ff656..d0555360284 100644 --- a/templates/single-product/add-to-cart/grouped.php +++ b/templates/single-product/add-to-cart/grouped.php @@ -33,6 +33,8 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?> 'price', ), $product ); + do_action( 'woocommerce_grouped_product_list_before' ); + foreach ( $grouped_products as $grouped_product_child ) { $post_object = get_post( $grouped_product_child->get_id() ); $quantites_required = $quantites_required || ( $grouped_product_child->is_purchasable() && ! $grouped_product_child->has_options() ); @@ -90,6 +92,8 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?> } $post = $previous_post; // WPCS: override ok. setup_postdata( $post ); + + do_action( 'woocommerce_grouped_product_list_after' ); ?> From 99407495b76b8ba0597d6e090695040112b9570b Mon Sep 17 00:00:00 2001 From: Jory Hogeveen Date: Thu, 21 Nov 2019 13:35:15 +0100 Subject: [PATCH 2/2] Add action parameters for context --- templates/single-product/add-to-cart/grouped.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/single-product/add-to-cart/grouped.php b/templates/single-product/add-to-cart/grouped.php index d0555360284..51a251be69b 100644 --- a/templates/single-product/add-to-cart/grouped.php +++ b/templates/single-product/add-to-cart/grouped.php @@ -33,7 +33,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?> 'price', ), $product ); - do_action( 'woocommerce_grouped_product_list_before' ); + do_action( 'woocommerce_grouped_product_list_before', $grouped_product_columns, $quantites_required, $product ); foreach ( $grouped_products as $grouped_product_child ) { $post_object = get_post( $grouped_product_child->get_id() ); @@ -93,7 +93,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?> $post = $previous_post; // WPCS: override ok. setup_postdata( $post ); - do_action( 'woocommerce_grouped_product_list_after' ); + do_action( 'woocommerce_grouped_product_list_after', $grouped_product_columns, $quantites_required, $product ); ?>