Решил, надо просто в sprintf передать url
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $product;
echo apply_filters(
'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
sprintf(
'<div class="btns-convert">
<a href="%s" class="white-btn">Подробнее</a>
<a href="%s" data-quantity="%s" class="main-btn %s" %s>%s</a>
</div>',
esc_url( get_permalink($product->get_id()) ),
esc_url( $product->add_to_cart_url() ),
esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),
esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ),
isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '',
esc_html( $product->add_to_cart_text() )
),
$product,
$args
);