isActive()) { $this->instance = Widget::getInstance(); remove_filter('woocommerce_get_price_html', [$this->instance, 'loadProductWidget']); add_filter('woocommerce_get_price_html', [$this, 'changePriceProductForWidget'], PHP_INT_MAX, 2); } } public function changePriceProductForWidget($price_html, $product): string { $salePrice = $product->get_sale_price(); if(!empty($salePrice)){ $product->set_price($salePrice); } return $this->instance->loadProductWidget($price_html, $product); } }