Last active
October 13, 2024 07:03
-
-
Save emre-edu-tech/5f1eefba8e3e16e01ef91d0251e5546d to your computer and use it in GitHub Desktop.
Change add to cart button to custom button on Product Archive Page
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
| <?php | |
| // Wooconmmerce - Change add to cart button to custom button on product archive page | |
| 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 = __("Produkt Details", "textdomain"); | |
| $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