Code Duplication    Length = 4-4 lines in 2 locations

includes/class-wc-cart.php 1 location

@@ 763-766 (lines=4) @@
760
				$code = WC_Tax::get_rate_code( $key );
761
762
				if ( $code || $key === apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) ) {
763
					if ( ! isset( $tax_totals[ $code ] ) ) {
764
						$tax_totals[ $code ] = new stdClass();
765
						$tax_totals[ $code ]->amount = 0;
766
					}
767
					$tax_totals[ $code ]->tax_rate_id       = $key;
768
					$tax_totals[ $code ]->is_compound       = WC_Tax::is_compound( $key );
769
					$tax_totals[ $code ]->label             = WC_Tax::get_rate_label( $key );

includes/abstracts/abstract-wc-order.php 1 location

@@ 744-747 (lines=4) @@
741
        foreach ( $this->get_items( 'tax' ) as $key => $tax ) {
742
            $code = $tax[ 'name' ];
743
744
            if ( ! isset( $tax_totals[ $code ] ) ) {
745
                $tax_totals[ $code ] = new stdClass();
746
                $tax_totals[ $code ]->amount = 0;
747
            }
748
749
            $tax_totals[ $code ]->id                = $key;
750
            $tax_totals[ $code ]->rate_id           = $tax['rate_id'];