Skip to content

Instantly share code, notes, and snippets.

@MarinescuLucia
Last active March 26, 2022 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarinescuLucia/b92e5fcc98596256c2eee26eb3026d9e to your computer and use it in GitHub Desktop.
Save MarinescuLucia/b92e5fcc98596256c2eee26eb3026d9e to your computer and use it in GitHub Desktop.
add_filter( 'woocommerce_loop_add_to_cart_link', 'replacing_add_to_cart_button', 10, 2 );
function replacing_add_to_cart_button( $button, $product ) {
$button_text = __("Buy product", "woocommerce");
$button = '<a class="button" href="' . $product->get_permalink() . '">' . $button_text . '</a>';
return $button;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment