Last active
January 19, 2021 16:47
-
-
Save jrick1229/b39c851aafd4751261345f4208d9e40c to your computer and use it in GitHub Desktop.
Add custom add to cart text (below add to cart button) on certain product IDs.
This file contains 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 | |
add_action( 'woocommerce_after_add_to_cart_button', 'custom_after_add_to_cart_btn' ); | |
function custom_after_add_to_cart_btn(){ | |
global $product; | |
$id = $product->get_id(); | |
$product_ids = array( 501, 176 ); | |
if(in_array( $id, $product_ids)) { | |
echo 'Some custom text here'; | |
} else { return; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment