Skip to content

Commit 00da7fa

Browse files
committed
Merge branch 'maindevelop' into github_pr
2 parents 4fc5d4a + 6af1543 commit 00da7fa

File tree

43 files changed

+404
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+404
-111
lines changed

app/code/Magento/Bundle/Setup/UpgradeData.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
4040
/** @var \Magento\Eav\Setup\EavSetup $eavSetup */
4141
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
4242

43-
$eavSetup->addAttributeGroup(ProductAttributeInterface::ENTITY_TYPE_CODE, 'Default', 'Bundle Items', 16);
43+
$attributeSetId = $eavSetup->getDefaultAttributeSetId(ProductAttributeInterface::ENTITY_TYPE_CODE);
44+
$eavSetup->addAttributeGroup(ProductAttributeInterface::ENTITY_TYPE_CODE, $attributeSetId, 'Bundle Items', 16);
4445

4546
$this->upgradePriceType($eavSetup);
4647
$this->upgradeSkuType($eavSetup);
@@ -133,9 +134,10 @@ private function upgradeWeightType(EavSetup $eavSetup)
133134
*/
134135
private function upgradeShipmentType(EavSetup $eavSetup)
135136
{
137+
$attributeSetId = $eavSetup->getDefaultAttributeSetId(ProductAttributeInterface::ENTITY_TYPE_CODE);
136138
$eavSetup->addAttributeToGroup(
137139
ProductAttributeInterface::ENTITY_TYPE_CODE,
138-
'Default',
140+
$attributeSetId,
139141
'Bundle Items',
140142
'shipment_type',
141143
1

app/code/Magento/Bundle/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<type name="Magento\Quote\Model\Quote\Item\Repository">
119119
<arguments>
120120
<argument name="cartItemProcessors" xsi:type="array">
121-
<item name="bundle" xsi:type="object">\Magento\Bundle\Model\CartItemProcessor</item>
121+
<item name="bundle" xsi:type="object">\Magento\Bundle\Model\CartItemProcessor\Proxy</item>
122122
</argument>
123123
</arguments>
124124
</type>

app/code/Magento/Catalog/Model/CustomOptions/CustomOptionProcessor.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ protected function updateOptionsValues(array &$options)
120120
$option->setOptionId($optionId);
121121
if (is_array($optionValue)) {
122122
$optionValue = $this->processFileOptionValue($optionValue);
123+
$optionValue = $this->processDateOptionValue($optionValue);
123124
$optionValue = implode(',', $optionValue);
124125
}
125126
$option->setOptionValue($optionValue);
@@ -147,6 +148,24 @@ private function processFileOptionValue(array $optionValue)
147148
return $optionValue;
148149
}
149150

151+
/**
152+
* Returns date option value only with 'date_internal data
153+
*
154+
* @param array $optionValue
155+
* @return array
156+
*/
157+
private function processDateOptionValue(array $optionValue)
158+
{
159+
if (array_key_exists('date_internal', $optionValue)
160+
) {
161+
$closure = function ($key) {
162+
return $key === 'date_internal';
163+
};
164+
$optionValue = array_filter($optionValue, $closure, ARRAY_FILTER_USE_KEY);
165+
}
166+
return $optionValue;
167+
}
168+
150169
/**
151170
* @return \Magento\Catalog\Model\Product\Option\UrlBuilder
152171
*

app/code/Magento/Catalog/Setup/UpgradeData.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -167,30 +167,31 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
167167
'frontend_label',
168168
'Product Name'
169169
);
170+
$attributeSetId = $categorySetup->getDefaultAttributeSetId(ProductAttributeInterface::ENTITY_TYPE_CODE);
170171
$categorySetup->addAttributeToGroup(
171172
ProductAttributeInterface::ENTITY_TYPE_CODE,
172-
'Default',
173+
$attributeSetId,
173174
'Product Details',
174175
'visibility',
175176
80
176177
);
177178
$categorySetup->addAttributeToGroup(
178179
ProductAttributeInterface::ENTITY_TYPE_CODE,
179-
'Default',
180+
$attributeSetId,
180181
'Product Details',
181182
'news_from_date',
182183
90
183184
);
184185
$categorySetup->addAttributeToGroup(
185186
ProductAttributeInterface::ENTITY_TYPE_CODE,
186-
'Default',
187+
$attributeSetId,
187188
'Product Details',
188189
'news_to_date',
189190
100
190191
);
191192
$categorySetup->addAttributeToGroup(
192193
ProductAttributeInterface::ENTITY_TYPE_CODE,
193-
'Default',
194+
$attributeSetId,
194195
'Product Details',
195196
'country_of_manufacture',
196197
110
@@ -199,26 +200,26 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
199200
//Content tab
200201
$categorySetup->addAttributeGroup(
201202
ProductAttributeInterface::ENTITY_TYPE_CODE,
202-
'Default',
203+
$attributeSetId,
203204
'Content',
204205
15
205206
);
206207
$categorySetup->updateAttributeGroup(
207208
ProductAttributeInterface::ENTITY_TYPE_CODE,
208-
'Default',
209+
$attributeSetId,
209210
'Content',
210211
'tab_group_code',
211212
'basic'
212213
);
213214
$categorySetup->addAttributeToGroup(
214215
ProductAttributeInterface::ENTITY_TYPE_CODE,
215-
'Default',
216+
$attributeSetId,
216217
'Content',
217218
'description'
218219
);
219220
$categorySetup->addAttributeToGroup(
220221
ProductAttributeInterface::ENTITY_TYPE_CODE,
221-
'Default',
222+
$attributeSetId,
222223
'Content',
223224
'short_description',
224225
100
@@ -227,20 +228,20 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
227228
//Images tab
228229
$groupId = (int)$categorySetup->getAttributeGroupByCode(
229230
ProductAttributeInterface::ENTITY_TYPE_CODE,
230-
'Default',
231+
$attributeSetId,
231232
'image-management',
232233
'attribute_group_id'
233234
);
234235
$categorySetup->addAttributeToGroup(
235236
ProductAttributeInterface::ENTITY_TYPE_CODE,
236-
'Default',
237+
$attributeSetId,
237238
$groupId,
238239
'image',
239240
1
240241
);
241242
$categorySetup->updateAttributeGroup(
242243
ProductAttributeInterface::ENTITY_TYPE_CODE,
243-
'Default',
244+
$attributeSetId,
244245
$groupId,
245246
'attribute_group_name',
246247
'Images'
@@ -282,27 +283,27 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
282283
//Schedule Design Update tab
283284
$categorySetup->addAttributeGroup(
284285
ProductAttributeInterface::ENTITY_TYPE_CODE,
285-
'Default',
286+
$attributeSetId,
286287
'Schedule Design Update',
287288
55
288289
);
289290
$categorySetup->updateAttributeGroup(
290291
ProductAttributeInterface::ENTITY_TYPE_CODE,
291-
'Default',
292+
$attributeSetId,
292293
'Schedule Design Update',
293294
'tab_group_code',
294295
'advanced'
295296
);
296297
$categorySetup->addAttributeToGroup(
297298
ProductAttributeInterface::ENTITY_TYPE_CODE,
298-
'Default',
299+
$attributeSetId,
299300
'Schedule Design Update',
300301
'custom_design_from',
301302
20
302303
);
303304
$categorySetup->addAttributeToGroup(
304305
ProductAttributeInterface::ENTITY_TYPE_CODE,
305-
'Default',
306+
$attributeSetId,
306307
'Schedule Design Update',
307308
'custom_design_to',
308309
30
@@ -316,7 +317,7 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
316317
);
317318
$categorySetup->addAttributeToGroup(
318319
ProductAttributeInterface::ENTITY_TYPE_CODE,
319-
'Default',
320+
$attributeSetId,
320321
'Schedule Design Update',
321322
'custom_design'
322323
);

app/code/Magento/Catalog/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@
537537
<type name="Magento\Quote\Model\Quote\Item\Repository">
538538
<arguments>
539539
<argument name="cartItemProcessors" xsi:type="array">
540-
<item name="custom_options" xsi:type="object">Magento\Catalog\Model\CustomOptions\CustomOptionProcessor</item>
540+
<item name="custom_options" xsi:type="object">Magento\Catalog\Model\CustomOptions\CustomOptionProcessor\Proxy</item>
541541
</argument>
542542
</arguments>
543543
</type>

app/code/Magento/Checkout/Block/Cart/Sidebar.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public function getConfig()
6969
'removeItemUrl' => $this->getRemoveItemUrl(),
7070
'imageTemplate' => $this->getImageHtmlTemplate(),
7171
'baseUrl' => $this->getBaseUrl(),
72-
'minicartMaxItemsVisible' => $this->getMiniCartMaxItemsCount()
72+
'minicartMaxItemsVisible' => $this->getMiniCartMaxItemsCount(),
73+
'websiteId' => $this->_storeManager->getStore()->getWebsiteId()
7374
];
7475
}
7576

app/code/Magento/Checkout/Block/Checkout/AttributeMerger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ protected function getMultilineFieldConfig($attributeCode, array $attributeConfi
272272
$attributeConfig['validation']
273273
)
274274
: $attributeConfig['validation'],
275-
'additionalClasses' => $isFirstLine ? : 'additional'
275+
'additionalClasses' => $isFirstLine ? 'field' : 'additional'
276276

277277
];
278278
if ($isFirstLine && isset($attributeConfig['default']) && $attributeConfig['default'] != null) {

app/code/Magento/Checkout/CustomerData/Cart.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public function getSectionData()
9696
'items' => $this->getRecentItems(),
9797
'extra_actions' => $this->layout->createBlock('Magento\Catalog\Block\ShortcutButtons')->toHtml(),
9898
'isGuestCheckoutAllowed' => $this->isGuestCheckoutAllowed(),
99+
'website_id' => $this->getQuote()->getStore()->getWebsiteId()
99100
];
100101
}
101102

app/code/Magento/Checkout/Test/Unit/Block/Cart/SidebarTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public function testGetTotalsHtml()
123123

124124
public function testGetConfig()
125125
{
126+
$websiteId = 100;
126127
$storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false);
127128

128129
$shoppingCartUrl = 'http://url.com/cart';
@@ -139,7 +140,8 @@ public function testGetConfig()
139140
'removeItemUrl' => $removeItemUrl,
140141
'imageTemplate' => $imageTemplate,
141142
'baseUrl' => $baseUrl,
142-
'minicartMaxItemsVisible' => 3
143+
'minicartMaxItemsVisible' => 3,
144+
'websiteId' => 100
143145
];
144146

145147
$valueMap = [
@@ -156,7 +158,7 @@ public function testGetConfig()
156158
$this->urlBuilderMock->expects($this->exactly(4))
157159
->method('getUrl')
158160
->willReturnMap($valueMap);
159-
$this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($storeMock);
161+
$this->storeManagerMock->expects($this->exactly(2))->method('getStore')->willReturn($storeMock);
160162
$storeMock->expects($this->once())->method('getBaseUrl')->willReturn($baseUrl);
161163
$this->imageHelper->expects($this->once())->method('getFrame')->willReturn(false);
162164

@@ -166,6 +168,8 @@ public function testGetConfig()
166168
\Magento\Checkout\Block\Cart\Sidebar::XML_PATH_CHECKOUT_SIDEBAR_COUNT,
167169
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
168170
)->willReturn(3);
171+
172+
$storeMock->expects($this->once())->method('getWebsiteId')->willReturn($websiteId);
169173

170174
$this->assertEquals($expectedResult, $this->model->getConfig());
171175
}

app/code/Magento/Checkout/Test/Unit/CustomerData/CartTest.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ public function testGetSectionData()
9393
$productRewrite = [$productId => ['rewrite' => 'product']];
9494
$itemData = ['item' => 'data'];
9595
$shortcutButtonsHtml = '<span>Buttons</span>';
96+
$websiteId = 100;
9697

9798
$subtotalMock = $this->getMock('\Magento\Framework\DataObject', ['getValue'], [], '', false);
9899
$subtotalMock->expects($this->once())->method('getValue')->willReturn($subtotalValue);
99100
$totals = ['subtotal' => $subtotalMock];
100101

101102
$quoteMock = $this->getMock(
102103
'\Magento\Quote\Model\Quote',
103-
['getTotals', 'getHasError', 'getAllVisibleItems'],
104+
['getTotals', 'getHasError', 'getAllVisibleItems', 'getStore'],
104105
[],
105106
'',
106107
false
@@ -119,6 +120,10 @@ public function testGetSectionData()
119120
$quoteItemMock = $this->getMock('\Magento\Quote\Model\Quote\Item', ['getProduct', 'getStoreId'], [], '', false);
120121
$quoteMock->expects($this->once())->method('getAllVisibleItems')->willReturn([$quoteItemMock]);
121122

123+
$storeMock = $this->getMock(\Magento\Store\Model\System\Store::class, ['getWebsiteId'], [], '', false);
124+
$storeMock->expects($this->once())->method('getWebsiteId')->willReturn($websiteId);
125+
$quoteMock->expects($this->once())->method('getStore')->willReturn($storeMock);
126+
122127
$productMock = $this->getMock(
123128
'\Magento\Catalog\Model\Product',
124129
['isVisibleInSiteVisibility', 'getId', 'setUrlDataObject'],
@@ -166,7 +171,8 @@ public function testGetSectionData()
166171
['item' => 'data']
167172
],
168173
'extra_actions' => '<span>Buttons</span>',
169-
'isGuestCheckoutAllowed' => 1
174+
'isGuestCheckoutAllowed' => 1,
175+
'website_id' => $websiteId
170176
];
171177
$this->assertEquals($expectedResult, $this->model->getSectionData());
172178
}
@@ -180,6 +186,7 @@ public function testGetSectionDataWithCompositeProduct()
180186
$subtotalValue = 200;
181187
$productId = 10;
182188
$storeId = 20;
189+
$websiteId = 100;
183190

184191
$productRewrite = [$productId => ['rewrite' => 'product']];
185192
$itemData = ['item' => 'data'];
@@ -190,7 +197,7 @@ public function testGetSectionDataWithCompositeProduct()
190197

191198
$quoteMock = $this->getMock(
192199
'\Magento\Quote\Model\Quote',
193-
['getTotals', 'getHasError', 'getAllVisibleItems'],
200+
['getTotals', 'getHasError', 'getAllVisibleItems', 'getStore'],
194201
[],
195202
'',
196203
false
@@ -207,6 +214,10 @@ public function testGetSectionDataWithCompositeProduct()
207214
$quoteMock->expects($this->once())->method('getTotals')->willReturn($totals);
208215
$quoteMock->expects($this->once())->method('getHasError')->willReturn(false);
209216

217+
$storeMock = $this->getMock(\Magento\Store\Model\System\Store::class, ['getWebsiteId'], [], '', false);
218+
$storeMock->expects($this->once())->method('getWebsiteId')->willReturn($websiteId);
219+
$quoteMock->expects($this->once())->method('getStore')->willReturn($storeMock);
220+
210221
$this->checkoutCartMock->expects($this->once())->method('getSummaryQty')->willReturn($summaryQty);
211222
$this->checkoutHelperMock->expects($this->once())
212223
->method('formatPrice')
@@ -271,7 +282,8 @@ public function testGetSectionDataWithCompositeProduct()
271282
['item' => 'data']
272283
],
273284
'extra_actions' => '<span>Buttons</span>',
274-
'isGuestCheckoutAllowed' => 1
285+
'isGuestCheckoutAllowed' => 1,
286+
'website_id' => $websiteId
275287
];
276288
$this->assertEquals($expectedResult, $this->model->getSectionData());
277289
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
</action>
1818
</referenceBlock>
1919
<referenceContainer name="content">
20-
<block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success" template="success.phtml" cacheable="false"/>
20+
<block class="Magento\Checkout\Block\Onepage\Success" name="checkout.success" template="success.phtml" cacheable="false">
21+
<container name="order.success.additional.info" label="Order Success Additional Info"/>
22+
</block>
2123
<block class="Magento\Checkout\Block\Registration" name="checkout.registration" template="registration.phtml" cacheable="false"/>
2224
</referenceContainer>
23-
<container name="order.success.additional.info" label="Order Success Additional Info"/>
2425
</body>
2526
</page>

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ define([
246246
target = $(this.options.minicart.list),
247247
outerHeight;
248248

249+
self.scrollHeight = 0;
249250
target.children().each(function () {
250251

251252
if ($(this).find('.options').length > 0) {
@@ -259,7 +260,7 @@ define([
259260
self.scrollHeight += outerHeight;
260261
});
261262

262-
target.height(height);
263+
target.parent().height(height);
263264
}
264265
});
265266

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,22 @@ define([
9898
self.isLoading(true);
9999
});
100100

101+
if (cartData().websiteId !== window.checkout.websiteId) {
102+
customerData.reload(['cart'], false);
103+
}
104+
101105
return this._super();
102106
},
103107
isLoading: ko.observable(false),
104108
initSidebar: initSidebar,
105109

110+
/**
111+
* Close mini shopping cart.
112+
*/
113+
closeMinicart: function () {
114+
$('[data-block="minicart"]').find('[data-role="dropdownDialog"]').dropdownDialog('close');
115+
},
116+
106117
/**
107118
* @return {Boolean}
108119
*/

0 commit comments

Comments
 (0)