Last active
May 13, 2021 09:45
-
-
Save tdmrhn/a9aea2cc3e35939b677655b3a527fd35 to your computer and use it in GitHub Desktop.
Add to Cart 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
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'replacing_add_to_cart_button', 10, 2 ); | |
function replacing_add_to_cart_button( $button, $product ) { | |
$button = '<a class="ct-button" href="' . $product->get_permalink() . '">View product</a>'; | |
return $button; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment