8000 magento/magento2#39959 catalog_product_save_before observer throws date-related error when using REST API without store-level values (getFinalPrice() issue) by KrasnoshchokBohdan · Pull Request #40003 · magento/magento2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

magento/magento2#39959 catalog_product_save_before observer throws date-related error when using REST API without store-level values (getFinalPrice() issue) #40003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: 2.4-develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public function execute(\Magento\Framework\Event\Observer $observer)
/** @var $product \Magento\Catalog\Model\Product */
$product = $observer->getEvent()->getProduct();
if ($product->getSpecialPrice() && $product->getSpecialFromDate() === null) {
$product->setData('special_from_date', $this->localeDate->date()->setTime(0, 0));
$product->setData(
'special_from_date',
$this->localeDate->date()->setTime(0, 0)->format('Y-m-d H:i:s')
);
}
return $this;
}
Expand Down
0