Skip to content

Commit

Permalink
WC: Fix Add to Cart Button Output & Resolve Error
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGStapleton committed Jun 25, 2024
1 parent daca571 commit 9d3145e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions woocommerce/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,19 +377,19 @@ 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(
'<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s"><span class="north-icon-cart" aria-hidden="true"></span> %s</a>',
esc_url( $product->add_to_cart_url() ),
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() )
);

Expand Down

0 comments on commit 9d3145e

Please sign in to comment.