Skip to content

Instantly share code, notes, and snippets.

@kwcjr
Last active February 12, 2022 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwcjr/5ec8104799b71892f276b81c2e619980 to your computer and use it in GitHub Desktop.
Save kwcjr/5ec8104799b71892f276b81c2e619980 to your computer and use it in GitHub Desktop.
Change add to cart text
// To change add to cart text on single product page.
add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_add_to_cart_callback' );
// To change add to cart text on product archives(Collection) page.
add_filter( 'woocommerce_product_add_to_cart_text', 'custom_add_to_cart_callback' );
// Custom add_to_cart text to change to.
function custom_add_to_cart_callback() {
return __( 'Submit Payment', 'text-domain' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment