Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active December 12, 2022 11:37
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 braddalton/291872e9e7ea2bef896fa92fa642dd42 to your computer and use it in GitHub Desktop.
Save braddalton/291872e9e7ea2bef896fa92fa642dd42 to your computer and use it in GitHub Desktop.
Change The Text of The Add To Cart Button On Specific Product Page Read More https://wpsites.net/?p=111218
add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_add_to_cart_button_text_single' );
function woocommerce_add_to_cart_button_text_single() {
if ( class_exists( 'woocommerce' ) AND is_product() AND get_the_ID() == 443 ) {
return __( 'Custom Cart Button Text', 'woocommerce' );
} else {
return __( 'Add To Cart', 'woocommerce' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment