Magento2: News From Date and Design Active From is set when setting Special Price for product.

Created on 3 May 2016  路  14Comments  路  Source: magento/magento2

Steps to reproduce

In backend, set a special price for a product.

Expected result

  1. That only the Special Price is set.

    Actual result

  2. The Special Price is set for the product

  3. If you leave the field Special Price From Date blank it is default set to todays date.(This i could consider ok)
  4. The field for News From Date in Autosettings is set to todays date. It's possible to change but it's not possoble to clear it.
  5. The filed Active From in Design is also set and can't be cleared.

Workaround for now is to set the News From Date and News To Date to passed dates if you are using for example a widget showing new products.

Fixed in 2.2.x Format is not valid Ready for Work bug report

Most helpful comment

Hi @joe980 , I increased priority for the fix. It won't be delivered in the next release 2.1.3, so it scheduled for 2.1.4. If any changes happened I inform you

All 14 comments

@antboiko can you check if this is working as intended/documented or a bug?

@thomasnordkvist
Hi Thomas, could you please tell me what Magento version you use?

Thanks,
Anton.

I have this issue in version 2.0.4 whish is the only version I have access to at the moment

@thomasnordkvist thanks for reporting this issue. Internal ticket MAGETWO-52577 was created.

Hi,
Has this issue been addressed at all? I am using Magento 2.1.2 and still the same issue is happening.
Is there a release planned that fixes this?

Hi @joe980 , I increased priority for the fix. It won't be delivered in the next release 2.1.3, so it scheduled for 2.1.4. If any changes happened I inform you

2.1.4 and 2.1.5 are out and bug still exists. can you raise priority so it will be included in 2.1.6?

2.15 still an issue for me.

I used this work around for now. Simply adding a date to all products that have NULL values in these fields.

Login in to PhpMyAdmin
Go to table catalog_product_entity_datetime
Find the attribute ids of news from date and news to date (or go to the attribute in admin and find id in the url key)
Run query below (change the atrribute_id(s) to match your ids obtained from above)

UPDATE catalog_product_entity_datetime
SET value = '2000-01-01 00:00:00'
WHERE attribute_id = 77 AND value IS NULL OR attribute_id = 78 AND value IS NULL

Still an issue in 2.1.6

Confirmed still an issue for 2.1.6

Confirmed still an issue for 2.1.7

The problem is that Magento\Catalog\Model\Attribute\Backend\Startdate sets the from-date to the current date when the product has a special price. This also incorrectly sets all other start/from dates, for instance the news_from_date. A possible fix is to add an extra check for the special_from_date attribute before setting it:

Change

if ($startDate == '' && $object->getSpecialPrice()) {
  $startDate = $this->_localeDate->date();
}

to

if ($attributeName == "special_from_date" && $startDate == '' && $object->getSpecialPrice()) {
  $startDate = $this->_localeDate->date();
}

Internal ticket to track issue progress: MAGETWO-72252

@thomasnordkvist thank you for your report.
The fix for this issue is already fixed in 2.2.0 release

Was this page helpful?
0 / 5 - 0 ratings