Custom button appearing on all product pages in Woocommerce
Question
I’m currently using this code with a hook to a specific product but the button seems to be appearing for all other products on my website as well.
add_action('woocommerce_after_add_to_cart_button','additional_single_product_button');
function additional_single_product_button() {
$product_ids = is_single(871);
echo "<br>";
echo "<br>";
echo '<div>';
echo '<a data-type="inline" class="button alt" href="/contact-us/">Pay at Spa @ $218 nett</a>';
echo '</div>';}
Here’s my website: http://offers.elements.com.sg/
Please advise how I can just add this button for a specific product. Thank you.
0
1 month
0 Answers
8 views
0
Leave an answer
You must login or register to add a new answer .