File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
app/code/Magento/Backend/Block/System/Store/Edit/Form Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ protected function _prepareStoreFieldset(\Magento\Framework\Data\Form $form)
108
108
);
109
109
}
110
110
111
- if (! $ websiteModel -> getIsDefault () && $ websiteModel-> getStoresCount ( )) {
111
+ if ($ this -> checkIsSingleAndIsDefaultStore ( $ websiteModel )) {
112
112
$ fieldset ->addField (
113
113
'is_default ' ,
114
114
'checkbox ' ,
@@ -133,4 +133,12 @@ protected function _prepareStoreFieldset(\Magento\Framework\Data\Form $form)
133
133
['name ' => 'website[website_id] ' , 'value ' => $ websiteModel ->getId ()]
134
134
);
135
135
}
136
+
137
+ private function checkIsSingleAndIsDefaultStore ($ websiteModel )
138
+ {
139
+ $ hasOnlyDefaultStore = $ websiteModel ->getStoresCount () == 1 &&
140
+ isset ($ websiteModel ->getStoreIds ()[\Magento \Store \Model \Store::DEFAULT_STORE_ID ]);
141
+
142
+ return !$ websiteModel ->getIsDefault () && $ websiteModel ->getStoresCount () && !$ hasOnlyDefaultStore ;
143
+ }
136
144
}
You can’t perform that action at this time.
0 commit comments