Skip to content

Instantly share code, notes, and snippets.

@soldier99
Created August 21, 2017 06:17
Show Gist options
  • Save soldier99/28963ed6d21127b0addc445dda4ebc68 to your computer and use it in GitHub Desktop.
Save soldier99/28963ed6d21127b0addc445dda4ebc68 to your computer and use it in GitHub Desktop.
Woocommerce Change the add to cart button INTO View Product button
// 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