/** * Function to check whether a product is a parent product or not * If is is a child product, it has a non-empty value for "product_parent_id" * * @param int $product_id * @return boolean True when the product is a parent product, false when product is a child item */ function is_product($product_id) { $product_parent_id = ps_product::get_field($product_id, 'product_parent_id'); return $product_parent_id == 0; }