10
10
use Magento \Customer \Api \AddressRepositoryInterface ;
11
11
use Magento \Customer \Api \CustomerRepositoryInterface ;
12
12
use Magento \Customer \Model \Session ;
13
- use Magento \Framework \App \DeploymentConfig ;
14
13
use Magento \Framework \Exception \InputException ;
15
14
use Magento \Framework \Exception \LocalizedException ;
16
15
use Magento \Framework \Exception \NoSuchEntityException ;
24
23
*/
25
24
class QuoteAddressValidator
26
25
{
27
- private const XML_CHECKOUT_CONFIG_VALUE = 'checkout/async ' ;
28
26
/**
29
27
* @var AddressRepositoryInterface
30
28
*/
@@ -42,29 +40,21 @@ class QuoteAddressValidator
42
40
*/
43
41
protected Session $ customerSession ;
44
42
45
- /**
46
- * @var DeploymentConfig
47
- */
48
- private DeploymentConfig $ deploymentConfig ;
49
-
50
43
/**
51
44
* Constructs a quote shipping address validator service object.
52
45
*
53
46
* @param AddressRepositoryInterface $addressRepository
54
47
* @param CustomerRepositoryInterface $customerRepository Customer repository.
55
48
* @param Session $customerSession
56
- * @param DeploymentConfig $deploymentConfig
57
49
*/
58
50
public function __construct (
59
51
AddressRepositoryInterface $ addressRepository ,
60
52
CustomerRepositoryInterface $ customerRepository ,
61
- Session $ customerSession ,
62
- DeploymentConfig $ deploymentConfig
53
+ Session $ customerSession
63
54
) {
64
55
$ this ->addressRepository = $ addressRepository ;
65
56
$ this ->customerRepository = $ customerRepository ;
66
57
$ this ->customerSession = $ customerSession ;
67
- $ this ->deploymentConfig = $ deploymentConfig ;
68
58
}
69
59
70
60
/**
@@ -164,10 +154,9 @@ private function doValidateForGuestQuoteAddress(AddressInterface $address, CartI
164
154
*/
165
155
public function validateForCart (CartInterface $ cart , AddressInterface $ address ): void
166
156
{
167
- if ((! $ this -> deploymentConfig -> get ( self :: XML_CHECKOUT_CONFIG_VALUE )) && $ cart ->getCustomerIsGuest ()) {
157
+ if ($ cart ->getCustomerIsGuest ()) {
168
158
$ this ->doValidateForGuestQuoteAddress ($ address , $ cart );
169
159
}
170
-
171
160
$ this ->doValidate ($ address , $ cart ->getCustomerIsGuest () ? null : (int ) $ cart ->getCustomer ()->getId ());
172
161
}
173
162
0 commit comments