@@ -133,8 +133,7 @@ protected function _prepareForm()
133
133
$ this ->_addAttributesToForm ($ attributes , $ fieldset );
134
134
135
135
$ this ->_form ->addFieldNameSuffix ('order[account] ' );
136
- $ storeId = (int )$ this ->_sessionQuote ->getStoreId ();
137
- $ this ->_form ->setValues ($ this ->extractValuesFromAttributes ($ attributes , $ storeId ));
136
+ $ this ->_form ->setValues ($ this ->extractValuesFromAttributes ($ attributes ));
138
137
139
138
return $ this ;
140
139
}
@@ -192,37 +191,18 @@ public function getFormValues()
192
191
* Extract the form values from attributes.
193
192
*
194
193
* @param array $attributes
195
- * @param int $storeId
196
194
* @return array
197
195
*/
198
- private function extractValuesFromAttributes (array $ attributes, int $ storeId ): array
196
+ private function extractValuesFromAttributes (array $ attributes ): array
199
197
{
200
198
$ formValues = $ this ->getFormValues ();
201
199
foreach ($ attributes as $ code => $ attribute ) {
202
200
$ defaultValue = $ attribute ->getDefaultValue ();
203
201
if (isset ($ defaultValue ) && !isset ($ formValues [$ code ])) {
204
202
$ formValues [$ code ] = $ defaultValue ;
205
203
}
206
- if ($ code === 'group_id ' && empty ($ defaultValue )) {
207
- $ formValues [$ code ] = $ this ->getDefaultCustomerGroup ($ storeId );
208
- }
209
204
}
210
205
211
206
return $ formValues ;
212
207
}
213
-
214
- /**
215
- * Gets default customer group.
216
- *
217
- * @param int $storeId
218
- * @return string|null
219
- */
220
- private function getDefaultCustomerGroup (int $ storeId ): ?string
221
- {
222
- return $ this ->_scopeConfig ->getValue (
223
- 'customer/create_account/default_group ' ,
224
- ScopeInterface::SCOPE_STORE ,
225
- $ storeId
226
- );
227
- }
228
208
}
0 commit comments