in functions.php of my templatefolder, I add this code to be able to have a second link on the product page.
but the result is an error 500.
I guess the product id part is wrong. Does anybody see how to solve this?
Woocommerce Version 3.4.5
function my_extra_button_on_product_page() {
global $product;
echo '<a class="single_add_to_cart_button button alt" href="?add-to-cart'<?=$product->get_id() ?>'">Second Link</a>';
}
I expect that the link that gets generated, has the add-to-cart=['product_id'] of course with the correct Product_id
But I get error 500