diff --git a/src/BlockTypes/AddToCartForm.php b/src/BlockTypes/AddToCartForm.php index 0ec14752e72..c035aca9172 100644 --- a/src/BlockTypes/AddToCartForm.php +++ b/src/BlockTypes/AddToCartForm.php @@ -29,7 +29,7 @@ class AddToCartForm extends AbstractBlock { protected function initialize() { parent::initialize(); add_filter( 'wc_add_to_cart_message_html', array( $this, 'add_to_cart_message_html_filter' ), 10, 2 ); - add_filter( 'woocommerce_add_to_cart_redirect', array( $this, 'add_to_cart_redirect_filter' ), 10, 2 ); + add_filter( 'woocommerce_add_to_cart_redirect', array( $this, 'add_to_cart_redirect_filter' ), 10, 1 ); } /** @@ -155,10 +155,9 @@ public function add_to_cart_message_html_filter( $message ) { * is clicked. * * @param string $url The URL to redirect to after the product is added to the cart. - * @param object $product The product being added to the cart. * @return string The filtered redirect URL. */ - public function add_to_cart_redirect_filter( $url, $product ) { + public function add_to_cart_redirect_filter( $url ) { // phpcs:ignore if ( isset( $_POST['is-descendent-of-single-product-block'] ) && 'true' == $_POST['is-descendent-of-single-product-block'] ) { return wp_validate_redirect( wp_get_referer(), $url );