Skip to content

Commit 487d59c

Browse files
committed
Merge remote-tracking branch 'main/develop' into MPI-S73-PR
2 parents 5c35e2f + 8c60b4b commit 487d59c

File tree

23 files changed

+158
-17
lines changed

23 files changed

+158
-17
lines changed

app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
<item name="component" xsi:type="string">Magento_Checkout/js/view/cart/shipping-estimation</item>
6363
<item name="provider" xsi:type="string">checkoutProvider</item>
6464
<item name="sortOrder" xsi:type="string">1</item>
65+
<item name="deps" xsi:type="array">
66+
<item name="0" xsi:type="string">block-summary.block-shipping.address-fieldsets</item>
67+
</item>
6568
<item name="children" xsi:type="array">
6669
<item name="address-fieldsets" xsi:type="array">
6770
<item name="component" xsi:type="string">uiComponent</item>

app/code/Magento/CheckoutAgreements/Block/Adminhtml/Agreement/Edit/Form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected function _prepareForm()
121121

122122
if (!$this->_storeManager->isSingleStoreMode()) {
123123
$field = $fieldset->addField(
124-
'store_id',
124+
'stores',
125125
'multiselect',
126126
[
127127
'name' => 'stores[]',
@@ -137,7 +137,7 @@ protected function _prepareForm()
137137
$field->setRenderer($renderer);
138138
} else {
139139
$fieldset->addField(
140-
'store_id',
140+
'stores',
141141
'hidden',
142142
['name' => 'stores[]', 'value' => $this->_storeManager->getStore(true)->getId()]
143143
);

app/code/Magento/CheckoutAgreements/Block/Adminhtml/Agreement/Grid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ protected function _prepareColumns()
7878

7979
if (!$this->_storeManager->isSingleStoreMode()) {
8080
$this->addColumn(
81-
'store_id',
81+
'stores',
8282
[
8383
'header' => __('Store View'),
84-
'index' => 'store_id',
84+
'index' => 'stores',
8585
'type' => 'store',
8686
'store_all' => true,
8787
'store_view' => true,

app/code/Magento/CheckoutAgreements/Model/CheckoutAgreementsRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function save(\Magento\CheckoutAgreements\Api\Data\AgreementInterface $da
124124
if ($storeId === null) {
125125
$storeId = $this->storeManager->getStore()->getId();
126126
}
127-
$data->setStores($storeId);
127+
$data->setStores([$storeId]);
128128
try {
129129
$this->resourceModel->save($data);
130130
} catch (\Exception $e) {

app/code/Magento/CheckoutAgreements/Model/ResourceModel/Agreement.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,16 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
7070
*/
7171
protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
7272
{
73-
$condition = ['agreement_id = ?' => $object->getId()];
74-
$this->getConnection()->delete($this->getTable('checkout_agreement_store'), $condition);
73+
$this->getConnection()->delete(
74+
$this->getTable('checkout_agreement_store'),
75+
['agreement_id = ?' => $object->getId()]
76+
);
7577

76-
foreach ((array)$object->getData('stores') as $store) {
77-
$storeArray = [];
78-
$storeArray['agreement_id'] = $object->getId();
79-
$storeArray['store_id'] = $store;
78+
foreach ((array)$object->getData('stores') as $storeId) {
79+
$storeArray = [
80+
'agreement_id' => $object->getId(),
81+
'store_id' => $storeId
82+
];
8083
$this->getConnection()->insert($this->getTable('checkout_agreement_store'), $storeArray);
8184
}
8285

@@ -96,8 +99,10 @@ protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
9699
->from($this->getTable('checkout_agreement_store'), ['store_id'])
97100
->where('agreement_id = :agreement_id');
98101

99-
if ($stores = $this->getConnection()->fetchCol($select, [':agreement_id' => $object->getId()])) {
100-
$object->setData('store_id', $stores);
102+
$stores = $this->getConnection()->fetchCol($select, [':agreement_id' => $object->getId()]);
103+
104+
if ($stores) {
105+
$object->setData('stores', $stores);
101106
}
102107

103108
return parent::_afterLoad($object);

app/code/Magento/CheckoutAgreements/view/frontend/web/template/checkout/checkout-agreements.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<!-- /ko -->
3838
<!-- /ko -->
3939
<div id="checkout-agreements-modal" data-bind="afterRender: initModal" style="display: none">
40-
<div class="checkout-agreements-item-title" data-bind="html: modalTitle"></div>
4140
<div class="checkout-agreements-item-content" data-bind="html: modalContent"></div>
4241
</div>
4342
</div>

app/code/Magento/GiftMessage/Test/Unit/Model/GuestItemRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function setUp()
8282
);
8383
$this->messageMock = $this->getMock('Magento\GiftMessage\Model\Message', [], [], '', false);
8484
$this->quoteItemMock = $this->getMock(
85-
'\Magento\Qote\Model\Quote\Item',
85+
'\Magento\Quote\Model\Quote\Item',
8686
[
8787
'getGiftMessageId',
8888
'__wakeup'

app/code/Magento/GiftMessage/Test/Unit/Model/ItemRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function setUp()
8282
);
8383
$this->messageMock = $this->getMock('Magento\GiftMessage\Model\Message', [], [], '', false);
8484
$this->quoteItemMock = $this->getMock(
85-
'\Magento\Qote\Model\Quote\Item',
85+
'\Magento\Quote\Model\Quote\Item',
8686
[
8787
'getGiftMessageId',
8888
'__wakeup'

app/code/Magento/GiftMessage/view/frontend/web/js/view/gift-message.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ define([
7070
hasActiveOptions: function() {
7171
var regionData = this.getRegion('additionalOptions');
7272
var options = regionData();
73-
for (var i in options) {
73+
for (var i = 0; i < options.length; i++) {
7474
if (options[i].isActive()) {
7575
return true;
7676
}

app/code/Magento/Quote/etc/webapi.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@
104104
<resource ref="Magento_Cart::manage" />
105105
</resources>
106106
</route>
107+
<route url="/V1/carts/:cartId/estimate-shipping-methods" method="POST">
108+
<service class="Magento\Quote\Api\ShippingMethodManagementInterface" method="estimateByAddress"/>
109+
<resources>
110+
<resource ref="Magento_Cart::manage" />
111+
</resources>
112+
</route>
113+
<route url="/V1/carts/:cartId/estimate-shipping-methods-by-address-id" method="POST">
114+
<service class="Magento\Quote\Api\ShippingMethodManagementInterface" method="estimateByAddressId"/>
115+
<resources>
116+
<resource ref="Magento_Cart::manage" />
117+
</resources>
118+
</route>
107119

108120
<!-- Managing My Cart Shipment Method -->
109121
<route url="/V1/carts/mine/shipping-methods" method="GET">

0 commit comments

Comments
 (0)