I am working with WooCommerce version 3.2.5 and I would like to display product id on each single product view.
I was reading some stackoverflow posts that I should add:
global $product;
$id = $product->id;
into functions.php and then make call to my variable with something like this:
"' . get_the_ID() . '"
But this doesn't work for me. I am getting error when i try to update functions.php.
So my goal is to read product ID and put it inside shortcode:
[add_to_cart id="99"]
with this I would be able to display add to cart in any place of single product.
Thank you for help.