Answer the question
In order to leave comments, you need to log in
How to determine in woocommerce that the current page is a product?
How can we determine in the functions.php file that we are on the product page.
is_product() function - always returns NULL
A construct
global $product;
$id = $product->get_id();
Answer the question
In order to leave comments, you need to log in
What hook are you hooking the function to? Use hooks starting with action - init.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question