-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Description
Steps to reproduce
- Install Magento 2.0.7 or before
- Create a second website, store and store view, let's assing the code "website2"
- Configure website2 to require vat number on registration:
config => customers => customer configuration => name and address options => show tax/vat number => REQUIRED (only for website2)
Expected result
- Vat number is not required for registering in main website
- Vat number is required for registering in website2
Actual result
- go to localhost/customer/account/create/ : Vat number is not required in main website
- go to localhost/website2/customer/account/create/ : Vat number is not shown in registration form of website2
- Clear the cache
- Access localhost/website2/customer/account/create/
- Vat number is now visible and required for both main website and website2
- Clear the cache
- Access localhost/customer/account/create/
- Vat number is now not visible and not required for both main website and website2.
I'm running multisite in website2 subdirectory.
website2/index.php
<?php
try {
require dirname(__DIR__) . '/app/bootstrap.php';
} catch(\Exception $e) {
echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
<div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
<h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
Autoload error</h3>
</div>
<p>{$e->getMessage()}</p>
</div>
HTML;
exit(1);
}
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
$app = $bootstrap->createApplication('\Magento\Framework\App\Http');
$bootstrap->run($app);
Both websites are configured to use the same pub directory.
The workaround is disabling "EAV types and attributes" - "Entity types declaration cache".
This issue seems similar to this one: #4556