Wrong date for Special Price
This article provides a patch for the known Adobe 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 are 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 a 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 the Commerce 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.
The start date for the special price should be the current date.
The start date for the special price is a date a few years in the future, preventing the special price from being active.
Applying the patch will prevent the issue from happening again. To correct the data for the products where the 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 Adobe Commerce versions:
The patch was created for:
- Adobe Commerce (all deployment methods) 2.2.2
The patch is also compatible (but might not solve the issue) with the following Adobe Commerce versions and editions:
- Adobe Commerce on-premises 2.1.0-2.1.18, 2.2.0-2.2.5
- Adobe Commerce on cloud infrastructure 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 Adobe Commerce for instructions.