File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
app/code/Magento/Catalog/Model/Product/Attribute/Backend Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,22 @@ protected function validatePrice(array $priceRow)
159159 */
160160 protected function modifyPriceData ($ object , $ data )
161161 {
162+ /** @var \Magento\Catalog\Model\Product $object */
162163 $ data = parent ::modifyPriceData ($ object , $ data );
163164 $ price = $ object ->getPrice ();
165+
166+ $ specialPrice = $ object ->getSpecialPrice ();
167+ $ specialPriceFromDate = $ object ->getSpecialFromDate ();
168+ $ specialPriceToDate = $ object ->getSpecialToDate ();
169+ $ today = time ();
170+
171+ if ($ specialPrice && ($ object ->getPrice () > $ object ->getFinalPrice ())){
172+ if ($ today >= strtotime ($ specialPriceFromDate ) && $ today <= strtotime ($ specialPriceToDate ) ||
173+ $ today >= strtotime ($ specialPriceFromDate ) && is_null ($ specialPriceToDate )) {
174+ $ price = $ specialPrice ;
175+ }
176+ }
177+
164178 foreach ($ data as $ key => $ tierPrice ) {
165179 $ percentageValue = $ this ->getPercentage ($ tierPrice );
166180 if ($ percentageValue ) {
You can’t perform that action at this time.
0 commit comments