Settings defined in website scopes are ignored in magento2

Today I will show you how you can fix the Settings defined in website scopes are ignored.

This is a core bug in 2.1.3 – https://github.com/magento/magento2/issues/7943

The change you need to make is to vendor/magento/module-store/Model/Config/Processor/Fallback.php

Change this

/**
* Retrieve Website Config
*
* @param array $websites
* @param int $id
* @return array
*/
private function getWebsiteConfig(array $websites, $id)
{
foreach ($this->websiteData as $website) {
if ($website[‘website_id’] == $id) {
$code = $website[‘website_id’];
return isset($websites[$code]) ? $websites[$code] : [];
}
}
return [];
}
To

/**
* Retrieve Website Config
*
* @param array $websites
* @param int $id
* @return array
*/
private function getWebsiteConfig(array $websites, $id)
{
foreach ($this->websiteData as $website) {
if ($website[‘website_id’] == $id) {
$code = $website[‘code’];
return isset($websites[$code]) ? $websites[$code] : [];
}
}
return [];
}

Note the line

$code = $website[‘code’];