This article provides a patch for the known Magento Commerce 2.2.2 issue related to the product special price "from" date being incorrect if its value is changed by the admin whose interface locale is different.
When you set/change the special price for a product, the current date and time is saved in the database as a value for the
special_from_date attribute (not visible when editing a product). If you edit the special price and your admin user account is set to different interface locale, a wrong value might be set to
special_from_date , because of the issues in parsing date format for different locales.
Steps to reproduce :
Prerequisites: the admin user locale is English (United States).
- Log in to Magento Admin.
- Go to the admin user account settings.
- Set Interface Locale to Ukrainian.
- Click Save Account .
- Go to Catalog > Product .
- Select any product.
- On the product page, click Advanced Pricing .
- Add a special price.
- Save the product.
- Repeat steps 7-9.
- Go to System > Action Logs .
- Check the log for product update.
Expected result : Start date for the special price should be the current date.
Actual result : Start date for the special price is for a date a few years in the future, preventing the special price for being active.
Applying the patch will prevent the issue from happening again. To correct the data for the products where date was set incorrectly, re-set the special price after applying the patch.
The patch is attached to this article. To download it, scroll down to the end of the article and click the file name, or click the following link:
Compatible Magento versions:
The patch was created for:
- Magento Commerce 2.2.2
The patch is also compatible (but might not solve the issue) with the following Magento versions and editions:
- Magento Commerce 2.1.0-2.1.18, 2.2.0-2.2.5
- Magento Commerce Cloud 2.1.11-2.1.18, 2.2.0-2.2.5
How to apply the patch
See How to apply a composer patch provided by Magento for instructions.