File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
app/code/core/Mage/SalesRule/Model/Resource Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,24 @@ protected function _afterLoad(Mage_Core_Model_Abstract $object)
6868 *
6969 *
7070 * @return $this
71+ * @throws Zend_Date_Exception
7172 */
7273 public function _beforeSave (Mage_Core_Model_Abstract $ object )
7374 {
7475 if (!$ object ->getDiscountQty ()) {
7576 $ object ->setDiscountQty (new Zend_Db_Expr ('NULL ' ));
7677 }
7778
79+ $ dateFrom = $ object ->getFromDate ();
80+ $ dateTo = $ object ->getToDate ();
81+
82+ # fix when from and to day are the same
83+ if (($ dateFrom instanceof Zend_Date && $ dateTo instanceof Zend_Date) &&
84+ ($ dateFrom ->getTimestamp () === $ dateTo ->getTimestamp ())
85+ ) {
86+ $ dateTo ->setHour (23 )->setMinute (59 )->setSecond (59 );
87+ }
88+
7889 parent ::_beforeSave ($ object );
7990 return $ this ;
8091 }
You can’t perform that action at this time.
0 commit comments