Skip to content
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

ProductAlert for out of stock not working #1699

Closed
Ingvar1917 opened this issue Aug 18, 2015 · 3 comments
Closed

ProductAlert for out of stock not working #1699

Ingvar1917 opened this issue Aug 18, 2015 · 3 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@Ingvar1917
Copy link

What I do:

  1. subscribe to a product is not in stock
  2. change inventory to "in stock", and start reindex (bin/magento indexer:reindex)
  3. 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.

@Ingvar1917
Copy link
Author

Sorry.
As you understand , I mean, if you remove the comments, the message is sent.

@elenleonova
Copy link

Hi, we have created an internal ticket to fix the issue: MAGETWO-42361

@elenleonova elenleonova added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Sep 1, 2015
@piotrekkaminski
Copy link
Contributor

This is fixed and should be published soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

4 participants