| @@ -41,13 +41,9 @@ | ||
| 41 | 41 | public function calculateTotals( $cart ) { |
| 42 | 42 | |
| 43 | 43 | if ( ! empty( $cart->cart_contents ) ) { |
| 44 | 44 | foreach ( $cart->cart_contents as $key => $cart_item ) { |
| 45 | - | |
| 46 | - $needPriceRecalculation = apply_filters( 'tier_pricing_table/cart/need_price_recalculation', true, $cart_item ); | |
| 47 | - | |
| 48 | - if ( $cart_item['data'] instanceof WC_Product && $needPriceRecalculation ) { | |
| 49 | - | |
| 45 | + if ( $cart_item['data'] instanceof WC_Product ) { | |
| 50 | 46 | $product_id = ! empty( $cart_item['variation_id'] ) ? $cart_item['variation_id'] : $cart_item['product_id']; |
| 51 | 47 | |
| 52 | 48 | $new_price = PriceManager::getPriceByRules( $cart_item['quantity'], $product_id ); |
| 53 | 49 | |
| @@ -72,12 +68,9 @@ | ||
| 72 | 68 | * |
| 73 | 69 | * @return string |
| 74 | 70 | */ |
| 75 | 71 | public function calculateItemPrice( $price, $cart_item ) { |
| 76 | - | |
| 77 | - $needPriceRecalculation = apply_filters( 'tier_pricing_table/cart/need_price_recalculation/item', true, $cart_item ); | |
| 78 | - | |
| 79 | - if ( $cart_item['data'] instanceof WC_Product && $needPriceRecalculation ) { | |
| 72 | + if ( $cart_item['data'] instanceof WC_Product ) { | |
| 80 | 73 | |
| 81 | 74 | $new_price = PriceManager::getPriceByRules( $cart_item['quantity'], $cart_item['data']->get_id() ); |
| 82 | 75 | |
| 83 | 76 | // To get real product price |