1010use Magento \Customer \Api \AddressRepositoryInterface ;
1111use Magento \Customer \Api \CustomerRepositoryInterface ;
1212use Magento \Customer \Model \Session ;
13- use Magento \Framework \App \DeploymentConfig ;
1413use Magento \Framework \Exception \InputException ;
1514use Magento \Framework \Exception \LocalizedException ;
1615use Magento \Framework \Exception \NoSuchEntityException ;
2423 */
2524class QuoteAddressValidator
2625{
27- private const XML_CHECKOUT_CONFIG_VALUE = 'checkout/async ' ;
2826 /**
2927 * @var AddressRepositoryInterface
3028 */
@@ -42,29 +40,21 @@ class QuoteAddressValidator
4240 */
4341 protected Session $ customerSession ;
4442
45- /**
46- * @var DeploymentConfig
47- */
48- private DeploymentConfig $ deploymentConfig ;
49-
5043 /**
5144 * Constructs a quote shipping address validator service object.
5245 *
5346 * @param AddressRepositoryInterface $addressRepository
5447 * @param CustomerRepositoryInterface $customerRepository Customer repository.
5548 * @param Session $customerSession
56- * @param DeploymentConfig $deploymentConfig
5749 */
5850 public function __construct (
5951 AddressRepositoryInterface $ addressRepository ,
6052 CustomerRepositoryInterface $ customerRepository ,
61- Session $ customerSession ,
62- DeploymentConfig $ deploymentConfig
53+ Session $ customerSession
6354 ) {
6455 $ this ->addressRepository = $ addressRepository ;
6556 $ this ->customerRepository = $ customerRepository ;
6657 $ this ->customerSession = $ customerSession ;
67- $ this ->deploymentConfig = $ deploymentConfig ;
6858 }
6959
7060 /**
@@ -164,10 +154,9 @@ private function doValidateForGuestQuoteAddress(AddressInterface $address, CartI
164154 */
165155 public function validateForCart (CartInterface $ cart , AddressInterface $ address ): void
166156 {
167- if ((! $ this -> deploymentConfig -> get ( self :: XML_CHECKOUT_CONFIG_VALUE )) && $ cart ->getCustomerIsGuest ()) {
157+ if ($ cart ->getCustomerIsGuest ()) {
168158 $ this ->doValidateForGuestQuoteAddress ($ address , $ cart );
169159 }
170-
171160 $ this ->doValidate ($ address , $ cart ->getCustomerIsGuest () ? null : (int ) $ cart ->getCustomer ()->getId ());
172161 }
173162
0 commit comments