Created
March 3, 2014 19:05
-
-
Save roykho/9332257 to your computer and use it in GitHub Desktop.
WooCommerce: Change add to cart text and link to redirect to single product page
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_loop_add_to_cart_link', 'change_add_to_cart_loop' ); | |
function change_add_to_cart_loop( $product ) { | |
global $product; // this may not be necessary as it should have pulled the object in already | |
return '<a href="' . esc_url( $product->get_permalink( $product->id ) ) . '">LEARN MORE</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment