File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Catalog/Model/Product/Type Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -629,6 +629,12 @@ public function calculateSpecialPrice(
629
629
$ store = null
630
630
) {
631
631
if ($ specialPrice !== null && $ specialPrice != false ) {
632
+
633
+ if ($ specialPriceTo && date ('H:i:s ' , strtotime ($ specialPriceTo )) !== '00:00:00 ' ) {
634
+ $ dateToTimestamp = strtotime ($ specialPriceTo );
635
+ $ specialPriceTo = date ('Y-m-d H:i:s ' , $ dateToTimestamp - 86400 );
636
+ }
637
+
632
638
if ($ this ->_localeDate ->isScopeDateInInterval ($ store , $ specialPriceFrom , $ specialPriceTo )) {
633
639
$ specialPrice = $ finalPrice * ($ specialPrice / 100 );
634
640
$ finalPrice = min ($ finalPrice , $ specialPrice );
Original file line number Diff line number Diff line change @@ -602,6 +602,11 @@ public function calculatePrice(
602
602
603
603
$ finalPrice = $ basePrice ;
604
604
605
+ if ($ specialPriceTo && date ('H:i:s ' , strtotime ($ specialPriceTo )) !== '00:00:00 ' ) {
606
+ $ dateToTimestamp = strtotime ($ specialPriceTo );
607
+ $ specialPriceTo = date ('Y-m-d H:i:s ' , $ dateToTimestamp - 86400 );
608
+ }
609
+
605
610
$ finalPrice = $ this ->calculateSpecialPrice (
606
611
$ finalPrice ,
607
612
$ specialPrice ,
@@ -642,6 +647,12 @@ public function calculateSpecialPrice(
642
647
$ store = null
643
648
) {
644
649
if ($ specialPrice !== null && $ specialPrice != false ) {
650
+
651
+ if ($ specialPriceTo && date ('H:i:s ' , strtotime ($ specialPriceTo )) !== '00:00:00 ' ) {
652
+ $ dateToTimestamp = strtotime ($ specialPriceTo );
653
+ $ specialPriceTo = date ('Y-m-d H:i:s ' , $ dateToTimestamp - 86400 );
654
+ }
655
+
645
656
if ($ this ->_localeDate ->isScopeDateInInterval ($ store , $ specialPriceFrom , $ specialPriceTo )) {
646
657
$ finalPrice = min ($ finalPrice , (float ) $ specialPrice );
647
658
}
You can’t perform that action at this time.
0 commit comments