Woocommerce | If page_id= .. { }

I am trying to apply specific functions to a certain page ID in Woocommerce.
However, it does not seem to apply. I have looked at both WordPress and Woommerce conditional tags (https://docs.woocommerce.com/document/conditional-tags/).

The simple code I am testing is shown below, but even that is not working.

if ( is_product()) {
    echo ' HALLO sdfdsfsdfsdfsdf ';

I have also tried with page_id and post_id but cannot get this to work.
I have added this code to my functions.php in my child theme.

Does anybody know to to write a specific function only for a specific product page (I know the value).

Read more here: Woocommerce | If page_id= .. { }

Leave a Reply

Your email address will not be published. Required fields are marked *