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
        );
  • I think you should first contact the extension vendor to look into the problem. – Mohit Kumar Arora Oct 31 '18 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. – Roy Jeurissen Oct 31 '18 at 13:16
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.

  • This doesn't work for me. Both options. Already set. – Roy Jeurissen Nov 1 '18 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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