Last active
December 12, 2022 11:37
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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