Closed
Description
What I do:
- subscribe to a product is not in stock
- change inventory to "in stock", and start reindex (bin/magento indexer:reindex)
- run cron, make sure the load observer app/code/Magento/ProductAlert/Model/Observer.php::process()
actual result - the message is not sent
I think the problem with the following code
app/code/Magento/CatalogInventory/Model/StockRegistry.php
public function getStockStatus($productId, $websiteId = null)
{
//if (!$websiteId) {
$websiteId = $this->stockConfiguration->getDefaultWebsiteId();
//}
return $this->stockRegistryProvider->getStockStatus($productId, $websiteId);
}
debug case:
public function getStockStatus($productId, $websiteId = null) // $websiteId == 1
{
//if (!$websiteId) {
$websiteId = $this->stockConfiguration->getDefaultWebsiteId(); $websiteId == 0
//}
return $this->stockRegistryProvider->getStockStatus($productId, $websiteId);
}
if remove commented code, the message is sent.
Thank you.