is_type( 'variable' ) ) { /** * Variable Product does not have its price. So it depends on variations. */ $class = new ProductPrice( new VariableProductPrice( $product, $config ), $product ); } elseif ( $product->is_type( 'grouped' ) ) { /** * Grouped Product does not have its price. So it depends on a group of simple Products. */ $class = new ProductPrice( new GroupProductPrice( $product, $config ), $product ); }elseif ( is_plugin_active( 'wpc-grouped-product/wpc-grouped-product.php' ) && $product->is_type( 'woosg' ) ) { /** * Grouped Product does not have its price. So its depends on a group of simple Products. * Plugin Name: WPC Grouped Product for WooCommerce. */ $class = new ProductPrice( new SgGroupProductPrice( $product, $config ), $product ); } else { /** * Simple Product, External Product, Product Variation, YITH Composite etc. * Note*: YITH does not auto select components. So no need to calculate component price. */ $class = new ProductPrice( new SimpleProductPrice( $product, $config ), $product ); } return $class; } }