Skip to content

Commit 18260e7

Browse files
#39169: Special Price To Date is wrongly validated on applySpecialPrice
- adding getter for SpecialPriceService
1 parent cff0ee8 commit 18260e7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/code/Magento/Bundle/Model/Product/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ public function calculateSpecialPrice(
634634
) {
635635
if ($specialPrice !== null && $specialPrice != false) {
636636

637-
$specialPriceTo = $this->specialPriceService->execute($specialPriceTo);
637+
$specialPriceTo = $this->getSpecialPriceService()->execute($specialPriceTo);
638638

639639
if ($this->_localeDate->isScopeDateInInterval($store, $specialPriceFrom, $specialPriceTo)) {
640640
$specialPrice = $finalPrice * ($specialPrice / 100);

app/code/Magento/Catalog/Model/Product/Type/Price.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class Price implements ResetAfterRequestInterface
9292
/**
9393
* @var SpecialPriceService|null
9494
*/
95-
protected ?SpecialPriceService $specialPriceService;
95+
private ?SpecialPriceService $specialPriceService;
9696

9797
/**
9898
* Constructor
@@ -138,6 +138,14 @@ public function __construct(
138138
->get(SpecialPriceService::class);
139139
}
140140

141+
/**
142+
* @return SpecialPriceService|null
143+
*/
144+
protected function getSpecialPriceService(): ?SpecialPriceService
145+
{
146+
return $this->specialPriceService;
147+
}
148+
141149
/**
142150
* Default action to get price of product
143151
*

0 commit comments

Comments
 (0)