Condition to check Product Type
-
Hello
I am trying to get product type in Woocommerce. I used below code$product = new WC_Product(38); //HardCode Product ID for testing if( $product->is_type( 'simple' ) ){ echo 'Simple'; } elseif( $product->is_type( 'variable' ) ){ echo 'Variable'; }
I found this at https://www.ads-software.com/support/topic/condition-to-check-if-product-is-simple-or-variable?replies=3
But it is not working. Please confirm what should i do.
Thank you
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Condition to check Product Type’ is closed to new replies.