| @@ -24,9 +24,9 @@ | ||
| 24 | 24 | ); |
| 25 | 25 | |
| 26 | 26 | public function __construct() { |
| 27 | 27 | |
| 28 | - // The service should be enabled by addons. This is useful to do not run this services when all pricing addons are disabled | |
| 28 | + // The service should be enabled by addons. This is useful to do not run those services when all pricing addons are disabled | |
| 29 | 29 | if ( ! apply_filters( 'tiered_pricing_table/services/pricing_service_enabled', false ) ) { |
| 30 | 30 | return; |
| 31 | 31 | } |
| 32 | 32 | |
| @@ -147,17 +147,17 @@ | ||
| 147 | 147 | return null; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | public function adjustPrice( $originalPrice, ?WC_Product $product ) { |
| 151 | - | |
| 152 | - if ( ! TierPricingTablePlugin::isSimpleProductSupported( $product ) ) { | |
| 151 | + | |
| 152 | + if ( ! $product ) { | |
| 153 | 153 | return $originalPrice; |
| 154 | 154 | } |
| 155 | - | |
| 156 | - if ( ! $product ) { | |
| 155 | + | |
| 156 | + if ( ! TierPricingTablePlugin::isSimpleProductSupported( $product ) ) { | |
| 157 | 157 | return $originalPrice; |
| 158 | 158 | } |
| 159 | - | |
| 159 | + | |
| 160 | 160 | if ( $product->get_meta( 'tiered_pricing_cart_price_calculated' ) === 'yes' ) { |
| 161 | 161 | return $originalPrice; |
| 162 | 162 | } |
| 163 | 163 | |