From 9d3145ef8c0f1ba8ec893aac3e48bb72d9a6e5c3 Mon Sep 17 00:00:00 2001 From: Alex S <17275120+AlexGStapleton@users.noreply.github.com> Date: Tue, 25 Jun 2024 23:46:54 +1200 Subject: [PATCH] WC: Fix Add to Cart Button Output & Resolve Error --- woocommerce/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/woocommerce/functions.php b/woocommerce/functions.php index 4fbb5a9..1577588 100644 --- a/woocommerce/functions.php +++ b/woocommerce/functions.php @@ -377,11 +377,11 @@ function siteorigin_north_wc_cart_wrapper_close() { } add_action( 'woocommerce_after_cart_table', 'siteorigin_north_wc_cart_wrapper_close' ); -function siteorigin_settings_override_add_to_cart_btn( $btn, $product, $args = [] ) { - $args = wp_parse_args( $args, [ +function siteorigin_settings_override_add_to_cart_btn( $btn, $product, $args = array() ) { + $args = wp_parse_args( $args, array( 'quantity' => 1, 'class' => 'button' - ] ); + ) ); $new_btn = sprintf( ' %s', @@ -389,7 +389,7 @@ function siteorigin_settings_override_add_to_cart_btn( $btn, $product, $args = [ esc_attr( $args['quantity'] ), esc_attr( $product->get_id()), esc_attr( $product->get_sku() ), - esc_attr( $args['class ']), + esc_attr( $args['class'] ), esc_html( $product->add_to_cart_text() ) );