eturn $types; } /** * Set the isBundle product attribute to 'true' if product is a bundle. * * @param WC_Product $product */ private function handle_update_product( WC_Product $product ) { if ( $product->is_type( 'bundle' ) ) { $this->attribute_manager->update( $product, new IsBundle( true ) ); } } /** * @param float $price Calculated price of the product * @param WC_Product $product WooCommerce product * @param bool $tax_excluded Whether tax is excluded from product price */ private function calculate_price( float $price, WC_Product $product, bool $tax_excluded ): float { if ( ! $product instanceof WC_Product_Bundle ) { return $price; } return $tax_excluded ? $product->get_bundle_regular_price_excluding_tax() : $product->get_bundle_regular_price_including_tax(); } /** * @param float $sale_price Calculated sale price of the product * @param WC_Product $product WooCommerce product * @param bool $tax_excluded Whether tax is excluded from product price */ private function calculate_sale_price( float $sale_price, WC_Product $product, bool $tax_excluded ): float { if ( ! $product instanceof WC_Product_Bundle ) { return $sale_price; } $regular_price = $tax_excluded ? $product->get_bundle_regular_price_excluding_tax() : $product->get_bundle_regular_price_including_tax(); $price = $tax_excluded ? $product->get_bundle_price_excluding_tax() : $product->get_bundle_price_including_tax(); // return current price as the sale price if it's lower than the regular price. if ( $price < $regular_price ) { return $price; } return $sale_price; } /** * @param bool $is_virtual Whether a product is virtual * @param WC_Product $product WooCommerce product */ private function is_virtual_bundle( bool $is_virtual, WC_Product $product ): bool { if ( $product instanceof WC_Product_Bundle && is_callable( [ $product, 'is_virtual_bundle' ] ) ) { return $product->is_virtual_bundle(); } return $is_virtual; } /** * Skip unsupported bundle products. * * @param WC_Product[] $products WooCommerce products */ private function get_sync_ready_bundle_products( array $products ): array { return array_filter( $products, function ( WC_Product $product ) { if ( $product instanceof WC_Product_Bundle && $product->requires_input() ) { return false; } return true; } ); } }
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Integration\WooCommerceProductBundles does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Warning: foreach() argument must be of type array|object, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73
Shop - NPS-Machines d'impression maroc