Custom button appearing on all product pages in Woocommerce


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.

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:

Please advise how I can just add this button for a specific product. Thank you.

EWG 1 month 0 Answers 8 views 0

Leave an answer