Check if a product is grouped with get_type() not working
-
Im trying to check if a product is a grouped product so that i can then get a list of the child products associated with it.
Based on the documentation im using $product->get_type(); example code below.
$product = new WC_Product( 90 ); $type = $product->get_type(); echo '<pre>'; print_r($type); echo '</pre>';
However this displays a type of simple, despite the product with ID 90 being a grouped product. Is this a bug or am i doing something wrong?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Check if a product is grouped with get_type() not working’ is closed to new replies.