Home › Forums › Basel support forum › Change "Add to Cart" text in grid view › Reply To: Change "Add to Cart" text in grid view
June 28, 2017 at 4:52 pm
#15708
Artem Temos
Keymaster
Hi,
Try to use this code instead
echo apply_filters( 'woocommerce_loop_add_to_cart_link',
sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s">Text<br>with break</a>',
esc_url( $product->add_to_cart_url() ),
esc_attr( isset( $quantity ) ? $quantity : 1 ),
esc_attr( $product->get_id() ),
esc_attr( $product->get_sku() ),
esc_attr( isset( $class ) ? $class : 'button' )
),
$product );