We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[HLD] Inconsistent saving of Stock Data
/** * {@inheritdoc} * * @return \Magento\Catalog\Api\Data\ProductExtensionInterface */ public function getExtensionAttributes() { $extensionAttributes = $this->_getExtensionAttributes(); if (!$extensionAttributes) { /** @var \Magento\Catalog\Api\Data\ProductExtensionInterface $extensionAttributes */ $extensionAttributes = $this->extensionAttributesFactory->create( \Magento\Catalog\Api\Data\ProductInterface::class ); $this->setExtensionAttributes($extensionAttributes); } return $extensionAttributes; }
After replacing, we nave a problem: the extensionAttributes is recreated every time the method is called.
The entities:
Remove the following from the \Magento\Catalog\Model\Product::afterSave:
if ($this->getStockData()) { $this->setForceReindexEavRequired(true); }
The text was updated successfully, but these errors were encountered:
naydav
No branches or pull requests
Full context in documentation
[HLD] Inconsistent saving of Stock Data
Description
1. Replace 'getExtensionAttributes' method
After replacing, we nave a problem: the extensionAttributes is recreated every time the method is called.
2. Fix 'toArray' and 'fromArray'
The entities:
must be changed to get the stock inventory data from the current StockItem.
3. Remove reindexing from 'afterSave'
Remove the following from the \Magento\Catalog\Model\Product::afterSave:
The text was updated successfully, but these errors were encountered: