diff --git a/src/Cron/UpdateSale.php b/src/Cron/UpdateIsSale.php similarity index 100% rename from src/Cron/UpdateSale.php rename to src/Cron/UpdateIsSale.php diff --git a/src/Service/ProductsUpdateService.php b/src/Service/ProductsUpdateService.php index 103760d..84914bd 100644 --- a/src/Service/ProductsUpdateService.php +++ b/src/Service/ProductsUpdateService.php @@ -8,7 +8,6 @@ use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory as ProductCollectionFactory; -use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Store\Api\Data\StoreInterface; use Magento\Store\Model\StoreManagerInterface; @@ -69,7 +68,7 @@ private function getProductsToCheck(StoreInterface $store): array private function isProductSale(ProductInterface $product): bool { - $finalPrice = (float)$product->getFinalPrice(); + $finalPrice = (float)$product->getData('final_price'); $originalPrice = (float)$product->getPrice(); if (!$finalPrice || !$originalPrice) { return false; diff --git a/src/Setup/Patch/Data/AddIdSaleAttribute.php b/src/Setup/Patch/Data/AddIsSaleAttribute.php similarity index 100% rename from src/Setup/Patch/Data/AddIdSaleAttribute.php rename to src/Setup/Patch/Data/AddIsSaleAttribute.php