Skip to content

Commit

Permalink
Merge pull request #449 from siteorigin/fix-add-to-cart-btn-output
Browse files Browse the repository at this point in the history
WC: Fix Add to Cart Button Output & Resolve Error
  • Loading branch information
AlexGStapleton authored Jun 26, 2024
2 parents daca571 + 9d3145e commit f49268b
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 f49268b

Please sign in to comment.