Skip to content

Instantly share code, notes, and snippets.

@AchalJ
Created September 21, 2021 16:53
Show Gist options
  • Select an option

  • Save AchalJ/91f707bf4a03fb10fcdf50b678120aa7 to your computer and use it in GitHub Desktop.

Select an option

Save AchalJ/91f707bf4a03fb10fcdf50b678120aa7 to your computer and use it in GitHub Desktop.
WooCommerce - Change variable product button text
add_filter( 'woocommerce_product_add_to_cart_text', function( $text, $product ) {
if ( 'variable' === $product->get_type() ) {
$text = __( 'Read More' );
}
return $text;
}, 11, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment