Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created December 12, 2022 10:15
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/88cf485c4592ee28729db23373f78fd9 to your computer and use it in GitHub Desktop.
Save braddalton/88cf485c4592ee28729db23373f78fd9 to your computer and use it in GitHub Desktop.
Modify Add To Cart Text WooCommerce Single Product 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() {
return ( class_exists( 'woocommerce' ) AND is_product() AND get_the_ID() == 443 ) ? __( 'Custom Cart Button Text', 'woocommerce' ) : __( 'Add To Cart', 'woocommerce' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment