Replies: 0
I’m using the add_to_cart shortcode on a non-product page and everything is working fine, with one exception: I can’t change the text from the default “Add to Cart”. Elsewhere, I have used this filter:
add_filter('woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text');
function woo_custom_cart_button_text() {
$button_text = 'Submit payment';
return __($button_text, 'woocommerce');
}
This works fine for add_to_cart buttons on the products archive page and the individual product pages, but not for the button created with the shortcode. How can I change the text for the shortcode?