| @@ -69,17 +69,14 @@ | ||
| 69 | 69 | $rules = self::getPriceRules( $product_id ); |
| 70 | 70 | $type = self::getPricingType( $product_id ); |
| 71 | 71 | if ( $type === 'fixed' ) { |
| 72 | 72 | foreach ( array_reverse( $rules, true ) as $_amount => $price ) { |
| 73 | - | |
| 74 | 73 | if ( $_amount <= $quantity ) { |
| 75 | 74 | $product_price = wc_get_price_to_display( wc_get_product( $product_id ), [ |
| 76 | 75 | 'price' => $price, |
| 77 | 76 | 'qty' => 1, |
| 78 | 77 | ] ); |
| 79 | - break; | |
| 80 | 78 | } |
| 81 | - | |
| 82 | 79 | } |
| 83 | 80 | } |
| 84 | 81 | |
| 85 | 82 | if ( $type === 'percentage' ) { |
| @@ -84,17 +81,14 @@ | ||
| 84 | 81 | |
| 85 | 82 | if ( $type === 'percentage' ) { |
| 86 | 83 | $product = wc_get_product( $product_id ); |
| 87 | 84 | foreach ( array_reverse( $rules, true ) as $_amount => $percentDiscount ) { |
| 88 | - | |
| 89 | 85 | if ( $_amount <= $quantity ) { |
| 90 | 86 | $product_price = wc_get_price_to_display( $product, [ |
| 91 | 87 | 'price' => self::getPriceByPercentDiscount( $product->get_price(), $percentDiscount ), |
| 92 | 88 | 'qty' => 1, |
| 93 | 89 | ] ); |
| 94 | - break; | |
| 95 | 90 | } |
| 96 | - | |
| 97 | 91 | } |
| 98 | 92 | } |
| 99 | 93 | |
| 100 | 94 | $product_price = ( isset( $product_price ) ? $product_price : false ); |