Skip to content

Commit 1d284ef

Browse files
committed
MC-19873: [Sample Data Function Test] Sample data test failed with Incorrect final price
1 parent 9372a0f commit 1d284ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ public function execute(Rule $rule, $batchCount, $useAdditionalTable = false)
101101
$scopeTz = new \DateTimeZone(
102102
$this->localeDate->getConfigTimezone(ScopeInterface::SCOPE_WEBSITE, $websiteId)
103103
);
104-
$fromTime = (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp();
104+
$fromTime = $rule->getFromDate()
105+
? (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp()
106+
: 0;
105107
$toTime = $rule->getToDate()
106108
? (new \DateTime($rule->getToDate(), $scopeTz))->getTimestamp() + IndexBuilder::SECONDS_IN_DAY - 1
107109
: 0;

0 commit comments

Comments
 (0)