1

I have installed the following module:

https://landofcoder.com/magento-2-out-of-stock-notification.html

It works like it's supposed to but getting an error.

When looking inside the module i see it tries to do the following when trying to send a notification email:

$alertGrid = $this->_appState->emulateAreaCode(
        \Magento\Framework\App\Area::AREA_FRONTEND,
        [$block, 'toHtml']
    );

It does this for each website that has enabled the product notification (and if a product comes back in stock)

I have 3 websites in one magento 2 installation. Each has it's own theme completely different than the other. lets call them theme 1 till theme 3.

When it tries to send a notification email for the website with theme 1, i already get the exception:

Required parameter 'theme_dir' was not passed.

This gets catched and will try to send the email for the websites withtheme 2 and theme 3.

Only the first theme fails and gives me the error.

Any idea which could be the problem? I tried to look in the theme table. but everything looks fine, path and everything. The theme works when i navigate to the website.

I will keep this updated.

Update 1

I have found the problem. It is storeview related.

The $block variable is based on storeid, it doesn't work with my storeId 1 (english). But when i hardcoded it to my storeview id 2 (dutch). It works. Any idea why it only happens with my default store id?

The block variable is build like this:

  $this->_getStockBlock()->setStore($store)->reset();
        foreach ($this->_stockProducts as $product) {
            $this->_getStockBlock()->addProduct($product);
        }
        $block = $this->_getStockBlock();
        $templateId = $this->_scopeConfig->getValue(
            self::XML_PATH_EMAIL_STOCK_TEMPLATE,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );
3
  • I think you should first contact the extension vendor to look into the problem. Oct 31, 2018 at 13:11
  • Well i did, they said they are getting a notification which i believe they. But they probably test it on the standard luma theme in their own demo store. I am having a hunch it's more a project issue than a module issue.
    – Prometheus
    Oct 31, 2018 at 13:16
  • @Prometheus, Have you found any solution, I am facing same issue in M2.4.4
    – Yogita
    Jul 1, 2022 at 12:53

1 Answer 1

2

1) Go to Content -> Configuration, select the scope (global, website, store_view) and change the theme. After you've done that you should also remove it from Content -> Themes.

OR IF ABOVE DOESN'T WORKS

Go to your core_config_data table and search for theme and you will get path = design/theme/theme_id replace your theme id in it.

1
  • This doesn't work for me. Both options. Already set.
    – Prometheus
    Nov 1, 2018 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.