back. $now = time(); $within_window = ! ( ( $date_from && $date_from->getTimestamp() > $now ) || ( $date_to && $date_to->getTimestamp() < $now ) ); // Reconcile only when the stored price is exactly the sale or regular price. A // deliberate custom `_price` that happens to equal one of them is indistinguishable // from a stale value and gets reconciled; any other custom value falls through. if ( ! $within_window && (float) $stored_price === (float) $sale_price ) { return $regular_price; } if ( $within_window && (float) $stored_price === (float) $regular_price ) { return $sale_price; } return $price; } }
Fatal error: Uncaught Automattic\WooCommerce\Internal\DependencyManagement\ContainerException: Attempt to get an instance of class 'Automattic\WooCommerce\Internal\ScheduledSalePriceReconciler', which doesn't exist. in /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php:105 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php(78): Automattic\WooCommerce\Internal\DependencyManagement\RuntimeContainer->get_core('Automattic\\WooC...', Array) #1 /htdocs/wp-content/plugins/woocommerce/src/Container.php(68): Automattic\WooCommerce\Internal\DependencyManagement\RuntimeContainer->get('Automattic\\WooC...') #2 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(445): Automattic\WooCommerce\Container->get('Automattic\\WooC...') #3 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(285): WooCommerce->init_hooks() #4 /htdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php(186): WooCommerce->__construct() #5 /htdocs/wp-content/plugins/woocommerce/woocommerce.php(55): WooCommerce::instance() #6 /htdocs/wp-content/plugins/woocommerce/woocommerce.php(70): WC() #7 /htdocs/wp-settings.php(597): include_once('/htdocs/wp-cont...') #8 /htdocs/wp-config.php(106): require_once('/htdocs/wp-sett...') #9 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #10 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #11 /htdocs/index.php(17): require('/htdocs/wp-blog...') #12 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php on line 105