Created
September 6, 2020 18:10
-
-
Save encoderit-arman/b2e095f531aa6b1a1a00e38e48030499 to your computer and use it in GitHub Desktop.
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
| add_filter( 'woocommerce_product_add_to_cart_text', 'custom_loop_add_to_cart_button', 20, 2 ); | |
| function custom_loop_add_to_cart_button( $button_text, $product ) { | |
| // HERE define your specific product IDs in this array | |
| $specific_ids = array(37, 40, 53); | |
| if( in_array($product->get_id(), $specific_ids) ) { | |
| $button_text = __("add to cart", "woocommerce"); | |
| } else { | |
| $button_text = __('+', 'woocommerce'); | |
| } | |
| return $button_text; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment