Skip to content

Commit 408f3ed

Browse files
committed
Merge branch 'ACP2E-3472' of https://github.com/adobe-commerce-tier-4/magento2ce into PR-Tier4-VK-2025-01-09
2 parents 6600201 + 83aaabc commit 408f3ed

File tree

3 files changed

+176
-58
lines changed

3 files changed

+176
-58
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2014 Adobe
3+
* All Rights Reserved.
44
*/
55

66
/**
@@ -84,6 +84,11 @@ define([
8484
$.each(elements, function (index, field) {
8585
uiRegistry.async(formPath + '.' + field)(self.doElementBinding.bind(self));
8686
});
87+
let regionId = uiRegistry.async(formPath + '.region_id');
88+
89+
if (regionId() !== undefined) {
90+
this.bindHandler(regionId(), self.validateDelay);
91+
}
8792
},
8893

8994
/**

app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Tax\Model\Sales\Total\Quote;
89

910
use Magento\Customer\Api\AccountManagementInterface as CustomerAccountManagement;
1011
use Magento\Customer\Api\Data\AddressInterfaceFactory as CustomerAddressFactory;
1112
use Magento\Customer\Api\Data\AddressInterface as CustomerAddress;
1213
use Magento\Customer\Api\Data\RegionInterfaceFactory as CustomerAddressRegionFactory;
13-
use Magento\Framework\DataObject;
1414
use Magento\Quote\Model\Quote\Address as QuoteAddress;
1515
use Magento\Quote\Model\Quote\Address\Total\AbstractTotal;
1616
use Magento\Quote\Model\Quote\Item\AbstractItem;
1717
use Magento\Store\Model\Store;
1818
use Magento\Tax\Api\Data\QuoteDetailsInterfaceFactory;
1919
use Magento\Tax\Api\Data\QuoteDetailsItemInterface;
20+
use Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory;
2021
use Magento\Tax\Api\Data\TaxClassKeyInterfaceFactory;
2122
use Magento\Tax\Api\Data\TaxClassKeyInterface;
2223
use Magento\Tax\Api\Data\TaxDetailsInterface;
2324
use Magento\Tax\Api\Data\TaxDetailsItemInterface;
2425
use Magento\Tax\Api\Data\QuoteDetailsInterface;
2526
use Magento\Quote\Api\Data\ShippingAssignmentInterface;
27+
use Magento\Tax\Api\TaxCalculationInterface;
2628
use Magento\Tax\Helper\Data as TaxHelper;
2729
use Magento\Framework\App\ObjectManager;
28-
use Magento\Tax\Api\Data\QuoteDetailsItemExtensionInterface;
2930
use Magento\Tax\Api\Data\QuoteDetailsItemExtensionInterfaceFactory;
31+
use Magento\Tax\Model\Config;
3032

3133
/**
3234
* Tax totals calculation model
@@ -155,11 +157,11 @@ class CommonTaxCollector extends AbstractTotal
155157
/**
156158
* Class constructor
157159
*
158-
* @param \Magento\Tax\Model\Config $taxConfig
159-
* @param \Magento\Tax\Api\TaxCalculationInterface $taxCalculationService
160+
* @param Config $taxConfig
161+
* @param TaxCalculationInterface $taxCalculationService
160162
* @param QuoteDetailsInterfaceFactory $quoteDetailsDataObjectFactory
161-
* @param \Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory $quoteDetailsItemDataObjectFactory
162-
* @param \Magento\Tax\Api\Data\TaxClassKeyInterfaceFactory $taxClassKeyDataObjectFactory
163+
* @param QuoteDetailsItemInterfaceFactory $quoteDetailsItemDataObjectFactory
164+
* @param TaxClassKeyInterfaceFactory $taxClassKeyDataObjectFactory
163165
* @param CustomerAddressFactory $customerAddressFactory
164166
* @param CustomerAddressRegionFactory $customerAddressRegionFactory
165167
* @param TaxHelper|null $taxHelper
@@ -210,16 +212,27 @@ public function _resetState(): void
210212
*/
211213
public function mapAddress(QuoteAddress $address)
212214
{
213-
$customerAddress = $this->customerAddressFactory->create();
214-
$customerAddress->setCountryId($address->getCountryId());
215-
$customerAddress->setRegion(
216-
$this->customerAddressRegionFactory->create()->setRegionId($address->getRegionId())
215+
$region = $this->customerAddressRegionFactory->create(
216+
[
217+
'data' => [
218+
'region_id' => $address->getRegionId(),
219+
'region_code' => $address->getRegionCode(),
220+
'region' => $address->getRegion()
221+
]
222+
]
217223
);
218-
$customerAddress->setPostcode($address->getPostcode());
219-
$customerAddress->setCity($address->getCity());
220-
$customerAddress->setStreet($address->getStreet());
221224

222-
return $customerAddress;
225+
return $this->customerAddressFactory->create(
226+
[
227+
'data' => [
228+
'country_id' => $address->getCountryId(),
229+
'region' => $region,
230+
'postcode' => $address->getPostcode(),
231+
'city' => $address->getCity(),
232+
'street' => $address->getStreet()
233+
]
234+
]
235+
);
223236
}
224237

225238
/**

0 commit comments

Comments
 (0)