Woocommerce If Product ID with Multiple Instance

I’m gonna create example array like that:

$myarray = array( 1,2,3 );

then fire:

if ( in_array( get_the_id(), $myarray ) ){
echo 'product ids 1 or 2 or 3';
}else{
echo 'product ids NOT 1 or 2 or 3';
}

Written by Uğur

Leave a Reply

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