Skip to content

Commit

Permalink
OM PR 4456
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Mar 5, 2025
1 parent 90b307c commit 9d6e3cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/code/core/Mage/SalesRule/Model/Resource/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ protected function _afterLoad(Mage_Core_Model_Abstract $object)
*
*
* @return $this
* @throws Zend_Date_Exception
*/
#[\Override]
public function _beforeSave(Mage_Core_Model_Abstract $object)
Expand All @@ -73,6 +74,16 @@ public function _beforeSave(Mage_Core_Model_Abstract $object)
$object->setDiscountQty(new Zend_Db_Expr('NULL'));
}

$dateFrom = $object->getFromDate();
$dateTo = $object->getToDate();

# fix when from and to day are the same
if (($dateFrom instanceof Zend_Date && $dateTo instanceof Zend_Date) &&
($dateFrom->getTimestamp() === $dateTo->getTimestamp())
) {
$dateTo->setHour(23)->setMinute(59)->setSecond(59);
}

parent::_beforeSave($object);
return $this;
}
Expand Down

0 comments on commit 9d6e3cc

Please sign in to comment.