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.
Start date for the special price should be the current date.
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.17, 2.2.0-2.2.5
- Magento Commerce Cloud 2.1.11-2.1.17, 2.2.0-2.2.5
How to apply the patch
We strongly recommend applying and testing the patch on the Integration/Staging environment, before applying it Production. We also recommend to have a recent backup before any manipulations.
How to apply this patch for Magento Commerce Cloud
- If you do not have a directory named
m2-hotfixesin the project root, please create one.
- Copy the
MDVA-11605_EE_2.2.2_COMPOSER_v1.patchfile to the
Add, commit, and push your code changes:
git add -A && git commit -m "Apply patch MDVA-11605_EE_2.2.2_COMPOSER_v1.patch" && git push origin
How to apply this patch for Magento Commerce
- Upload the patch to your Magento root directory.
- Run the following SSH command:
(If the above command does not work, try using
patch -p1 < MDVA-11605_EE_2.2.2_COMPOSER_v1.patch
- For the changes to be reflected, refresh the cache in the Admin under System > Cache Management.