Skip to content

Instantly share code, notes, and snippets.

@roykho
Created March 3, 2014 19:05
Show Gist options
  • Save roykho/9332257 to your computer and use it in GitHub Desktop.
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
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