second add to cart link : <p>in functions.php of my templatefolder, I add this code to be able to have a second link on the product page.</p>

<p>but the result is an error 500.</p>

<p>I guess the product id part is wrong. Does anybody see how to solve this?</p>

<p>Woocommerce Version 3.4.5</p>

<pre><code>
function my_extra_button_on_product_page() {
  global $product;
echo '&lt;a class="single_add_to_cart_button button alt" href="?add-to-cart'&lt;?=$product-&gt;get_id() ?&gt;'"&gt;Second Link&lt;/a&gt;';
}
</code></pre>

<p>I expect that the link that gets generated, has the add-to-cart=['product_id'] of course with the correct Product_id </p>

<p>But I get error 500</p>
