Created
August 21, 2017 06:17
-
-
Save soldier99/28963ed6d21127b0addc445dda4ebc68 to your computer and use it in GitHub Desktop.
Woocommerce Change the add to cart button INTO View Product button
This file contains hidden or 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
// Change the add to cart button INTO View Product button | |
// ================================================================================================================= | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'add_product_link' ); | |
function add_product_link( $link ) { | |
global $product; | |
echo '<a href="'.$product->get_permalink( $product->id ).'" class="button">' . __('View Product', 'woocommerce') . '</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment