get_raw_conversion( $price, $to_currency, $from_currency ); if ( ! empty( $price ) && is_float( $price ) ) { $price = wc_round_tax_total( $price, 4 ); } } } return $price; } /** * Check if product price should be convert or not * * @param bool $should_convert should convert or not. * @param object $product instance of the product. * @return float */ public function should_convert_product_price( $should_convert = true, $product = null ) { global $woocommerce_smart_coupon; if ( ! $product instanceof WC_Product ) { return $should_convert; } $coupons = $woocommerce_smart_coupon->get_coupon_titles( array( 'product_object' => $product ) ); if ( ! empty( $coupons ) && $woocommerce_smart_coupon->is_coupon_amount_pick_from_product_price( $coupons ) ) { foreach ( $coupons as $coupon_title ) { $coupon_of_product = new WC_Coupon( $coupon_title ); $discount_type_of_product = ( is_object( $coupon_of_product ) && is_callable( array( $coupon_of_product, 'get_discount_type' ) ) ) ? $coupon_of_product->get_discount_type() : ''; if ( 'smart_coupon' === $discount_type_of_product ) { return false; } } } return $should_convert; } } } WC_SC_WooPayments_Compatibility::get_instance();