20
20
use Magento \Customer \Model \Customer as CustomerModel ;
21
21
use Magento \Customer \Model \Customer \CredentialsValidator ;
22
22
use Magento \Customer \Model \ForgotPasswordToken \GetCustomerByToken ;
23
+ use Magento \Customer \Model \Logger as CustomerLogger ;
23
24
use Magento \Customer \Model \Metadata \Validator ;
24
25
use Magento \Customer \Model \ResourceModel \Visitor \CollectionFactory ;
25
26
use Magento \Directory \Model \AllowedCountries ;
57
58
use Magento \Store \Model \ScopeInterface ;
58
59
use Magento \Store \Model \StoreManagerInterface ;
59
60
use Psr \Log \LoggerInterface as PsrLogger ;
60
- use Magento \Customer \Model \Logger as CustomerLogger ;
61
61
62
62
/**
63
63
* Handle various customer account actions
@@ -72,7 +72,7 @@ class AccountManagement implements AccountManagementInterface
72
72
/**
73
73
* System Configuration Path for Enable/Disable Login at Guest Checkout
74
74
*/
75
- private const GUEST_CHECKOUT_LOGIN_OPTION_SYS_CONFIG = 'checkout/options/disable_guest_checkout_login ' ;
75
+ private const GUEST_CHECKOUT_LOGIN_OPTION_SYS_CONFIG = 'checkout/options/enable_guest_checkout_login ' ;
76
76
77
77
/**
78
78
* Configuration paths for create account email template
@@ -223,177 +223,177 @@ class AccountManagement implements AccountManagementInterface
223
223
/**
224
224
* @var CustomerFactory
225
225
*/
226
- private $ customerFactory ;
226
+ private CustomerFactory $ customerFactory ;
227
227
228
228
/**
229
229
* @var ValidationResultsInterfaceFactory
230
230
*/
231
- private $ validationResultsDataFactory ;
231
+ private ValidationResultsInterfaceFactory $ validationResultsDataFactory ;
232
232
233
233
/**
234
234
* @var ManagerInterface
235
235
*/
236
- private $ eventManager ;
236
+ private ManagerInterface $ eventManager ;
237
237
238
238
/**
239
239
* @var StoreManagerInterface
240
240
*/
241
- private $ storeManager ;
241
+ private StoreManagerInterface $ storeManager ;
242
242
243
243
/**
244
244
* @var Random
245
245
*/
246
- private $ mathRandom ;
246
+ private Random $ mathRandom ;
247
247
248
248
/**
249
249
* @var Validator
250
250
*/
251
- private $ validator ;
251
+ private Validator $ validator ;
252
252
253
253
/**
254
254
* @var AddressRepositoryInterface
255
255
*/
256
- private $ addressRepository ;
256
+ private AddressRepositoryInterface $ addressRepository ;
257
257
258
258
/**
259
259
* @var CustomerMetadataInterface
260
260
*/
261
- private $ customerMetadataService ;
261
+ private CustomerMetadataInterface $ customerMetadataService ;
262
262
263
263
/**
264
264
* @var PsrLogger
265
265
*/
266
- protected $ logger ;
266
+ protected PsrLogger $ logger ;
267
267
268
268
/**
269
269
* @var Encryptor
270
270
*/
271
- private $ encryptor ;
271
+ private Encryptor $ encryptor ;
272
272
273
273
/**
274
274
* @var CustomerRegistry
275
275
*/
276
- private $ customerRegistry ;
276
+ private CustomerRegistry $ customerRegistry ;
277
277
278
278
/**
279
279
* @var ConfigShare
280
280
*/
281
- private $ configShare ;
281
+ private ConfigShare $ configShare ;
282
282
283
283
/**
284
284
* @var StringHelper
285
285
*/
286
- protected $ stringHelper ;
286
+ protected StringHelper $ stringHelper ;
287
287
288
288
/**
289
289
* @var CustomerRepositoryInterface
290
290
*/
291
- private $ customerRepository ;
291
+ private CustomerRepositoryInterface $ customerRepository ;
292
292
293
293
/**
294
294
* @var ScopeConfigInterface
295
295
*/
296
- private $ scopeConfig ;
296
+ private ScopeConfigInterface $ scopeConfig ;
297
297
298
298
/**
299
299
* @var TransportBuilder
300
300
*/
301
- private $ transportBuilder ;
301
+ private TransportBuilder $ transportBuilder ;
302
302
303
303
/**
304
304
* @var DataObjectProcessor
305
305
*/
306
- protected $ dataProcessor ;
306
+ protected DataObjectProcessor $ dataProcessor ;
307
307
308
308
/**
309
309
* @var Registry
310
310
*/
311
- protected $ registry ;
311
+ protected Registry $ registry ;
312
312
313
313
/**
314
314
* @var CustomerViewHelper
315
315
*/
316
- protected $ customerViewHelper ;
316
+ protected CustomerViewHelper $ customerViewHelper ;
317
317
318
318
/**
319
319
* @var DateTime
320
320
*/
321
- protected $ dateTime ;
321
+ protected DateTime $ dateTime ;
322
322
323
323
/**
324
324
* @var ObjectFactory
325
325
*/
326
- protected $ objectFactory ;
326
+ protected ObjectFactory $ objectFactory ;
327
327
328
328
/**
329
329
* @var ExtensibleDataObjectConverter
330
330
*/
331
- protected $ extensibleDataObjectConverter ;
331
+ protected ExtensibleDataObjectConverter $ extensibleDataObjectConverter ;
332
332
333
333
/**
334
334
* @var CustomerModel
335
335
*/
336
- protected $ customerModel ;
336
+ protected CustomerModel $ customerModel ;
337
337
338
338
/**
339
339
* @var AuthenticationInterface
340
340
*/
341
- protected $ authentication ;
341
+ protected AuthenticationInterface $ authentication ;
342
342
343
343
/**
344
344
* @var EmailNotificationInterface
345
345
*/
346
- private $ emailNotification ;
346
+ private EmailNotificationInterface $ emailNotification ;
347
347
348
348
/**
349
349
* @var Backend
350
350
*/
351
- private $ eavValidator ;
351
+ private Backend $ eavValidator ;
352
352
353
353
/**
354
354
* @var CredentialsValidator
355
355
*/
356
- private $ credentialsValidator ;
356
+ private CredentialsValidator $ credentialsValidator ;
357
357
358
358
/**
359
359
* @var DateTimeFactory
360
360
*/
361
- private $ dateTimeFactory ;
361
+ private DateTimeFactory $ dateTimeFactory ;
362
362
363
363
/**
364
364
* @var AccountConfirmation
365
365
*/
366
- private $ accountConfirmation ;
366
+ private AccountConfirmation $ accountConfirmation ;
367
367
368
368
/**
369
369
* @var SearchCriteriaBuilder
370
370
*/
371
- private $ searchCriteriaBuilder ;
371
+ private SearchCriteriaBuilder $ searchCriteriaBuilder ;
372
372
373
373
/**
374
374
* @var AddressRegistry
375
375
*/
376
- private $ addressRegistry ;
376
+ private AddressRegistry $ addressRegistry ;
377
377
378
378
/**
379
379
* @var AllowedCountries
380
380
*/
381
- private $ allowedCountriesReader ;
381
+ private AllowedCountries $ allowedCountriesReader ;
382
382
383
383
/**
384
384
* @var GetCustomerByToken
385
385
*/
386
- private $ getByToken ;
386
+ private GetCustomerByToken $ getByToken ;
387
387
388
388
/**
389
389
* @var SessionCleanerInterface
390
390
*/
391
- private $ sessionCleaner ;
391
+ private SessionCleanerInterface $ sessionCleaner ;
392
392
393
393
/**
394
394
* @var AuthorizationInterface
395
395
*/
396
- private $ authorization ;
396
+ private AuthorizationInterface $ authorization ;
397
397
398
398
/**
399
399
* @var CustomerLogger
@@ -1142,6 +1142,10 @@ public function validate(CustomerInterface $customer)
1142
1142
1143
1143
/**
1144
1144
* @inheritdoc
1145
+ *
1146
+ * @param string $customerEmail
1147
+ * @param int $websiteId
1148
+ * @return bool
1145
1149
*/
1146
1150
public function isEmailAvailable (string $ customerEmail , int $ websiteId = null ): bool
1147
1151
{
@@ -1151,7 +1155,7 @@ public function isEmailAvailable(string $customerEmail, int $websiteId = null):
1151
1155
$ websiteId
1152
1156
);
1153
1157
1154
- if (! $ guestLoginConfig ) {
1158
+ if ($ guestLoginConfig === null || $ guestLoginConfig === false ) {
1155
1159
return true ;
1156
1160
}
1157
1161
0 commit comments