Code Duplication    Length = 15-15 lines in 2 locations

includes/widgets/class-wc-widget-price-filter.php 1 location

@@ 128-142 (lines=15) @@
125
		}
126
127
		// Adjust min and max if the store taxes are not displayed how they are stored
128
		if ( wc_tax_enabled() && 'incl' === get_option( 'woocommerce_tax_display_shop' ) && ! wc_prices_include_tax() ) {
129
			$tax_classes = array_merge( array( '' ), WC_Tax::get_tax_classes() );
130
131
			foreach ( $tax_classes as $tax_class ) {
132
				$tax_rates = WC_Tax::get_rates( $tax_class );
133
				$class_min = $min + WC_Tax::get_tax_total( WC_Tax::calc_exclusive_tax( $min, $tax_rates ) );
134
				$class_max = $max + WC_Tax::get_tax_total( WC_Tax::calc_exclusive_tax( $max, $tax_rates ) );
135
				if ( $class_min < $min ) {
136
					$min = $class_min;
137
				}
138
				if ( $class_max > $max ) {
139
					$max = $class_max;
140
				}
141
			}
142
		}
143
144
		echo '<form method="get" action="' . esc_url( $form_action ) . '">
145
			<div class="price_slider_wrapper">

includes/class-wc-query.php 1 location

@@ 521-535 (lines=15) @@
518
			$max = isset( $_GET['max_price'] ) ? floatval( $_GET['max_price'] ) : 9999999999;
519
520
			// If displaying prices in the shop including taxes, but prices don't include taxes..
521
			if ( wc_tax_enabled() && 'incl' === get_option( 'woocommerce_tax_display_shop' ) && ! wc_prices_include_tax() ) {
522
				$tax_classes = array_merge( array( '' ), WC_Tax::get_tax_classes() );
523
524
				foreach ( $tax_classes as $tax_class ) {
525
					$tax_rates = WC_Tax::get_rates( $tax_class );
526
					$class_min = $min - WC_Tax::get_tax_total( WC_Tax::calc_inclusive_tax( $min, $tax_rates ) );
527
					$class_max = $max - WC_Tax::get_tax_total( WC_Tax::calc_inclusive_tax( $max, $tax_rates ) );
528
					if ( $class_min < $min ) {
529
						$min = $class_min;
530
					}
531
					if ( $class_max > $max ) {
532
						$max = $class_max;
533
					}
534
				}
535
			}
536
537
			return array(
538
				'key'          => '_price',