Skip to content

Commit 2e35f43

Browse files
Merge branch '2.0' into MDVA-126
2 parents c7d0490 + bfc289e commit 2e35f43

File tree

44 files changed

+602
-476
lines changed

Some content is hidden

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

44 files changed

+602
-476
lines changed

app/code/Magento/Catalog/Pricing/Render/FinalPriceBox.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,16 @@ public function showMinimalPrice()
118118
&& $minimalPriceAValue
119119
&& $minimalPriceAValue < $finalPriceValue;
120120
}
121+
122+
/**
123+
* {@inheritdoc}
124+
*
125+
* @return array
126+
*/
127+
public function getCacheKeyInfo()
128+
{
129+
$cacheKeys = parent::getCacheKeyInfo();
130+
$cacheKeys['display_minimal_price'] = $this->getDisplayMinimalPrice();
131+
return $cacheKeys;
132+
}
121133
}

app/code/Magento/Catalog/Test/Unit/Pricing/Render/FinalPriceBoxTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ protected function setUp()
8181
->method('getBlock')
8282
->will($this->returnValue($this->priceBox));
8383

84+
$storeManager = $this->getMockBuilder('\Magento\Store\Model\StoreManagerInterface')
85+
->setMethods(['getStore', 'getCode'])
86+
->getMockForAbstractClass();
87+
$storeManager->expects($this->any())->method('getStore')->willReturnSelf();
88+
89+
$appState = $this->getMockBuilder('\Magento\Framework\App\State')
90+
->disableOriginalConstructor()
91+
->getMock();
92+
93+
$resolver = $this->getMockBuilder('\Magento\Framework\View\Element\Template\File\Resolver')
94+
->disableOriginalConstructor()
95+
->getMock();
96+
97+
$urlBuilder = $this->getMockBuilder('\Magento\Framework\UrlInterface')
98+
->getMockForAbstractClass();
99+
84100
$scopeConfigMock = $this->getMockForAbstractClass('Magento\Framework\App\Config\ScopeConfigInterface');
85101
$context = $this->getMock('Magento\Framework\View\Element\Template\Context', [], [], '', false);
86102
$context->expects($this->any())
@@ -98,6 +114,17 @@ protected function setUp()
98114
$context->expects($this->any())
99115
->method('getScopeConfig')
100116
->will($this->returnValue($scopeConfigMock));
117+
$context->expects($this->any())
118+
->method('getStoreManager')
119+
->will($this->returnValue($storeManager));
120+
$context->expects($this->any())
121+
->method('getAppState')
122+
->will($this->returnValue($appState));
123+
$context->expects($this->any())
124+
->method('getResolver')
125+
->will($this->returnValue($resolver));
126+
$context->expects($this->any())
127+
->method('getUrlBuilder')->will($this->returnValue($urlBuilder));
101128

102129
$this->rendererPool = $this->getMockBuilder('Magento\Framework\Pricing\Render\RendererPool')
103130
->disableOriginalConstructor()
@@ -332,4 +359,9 @@ public function testHidePrice()
332359

333360
$this->assertEmpty($this->object->toHtml());
334361
}
362+
363+
public function testGetCacheKeyInfo()
364+
{
365+
$this->assertArrayHasKey('display_minimal_price', $this->object->getCacheKeyInfo());
366+
}
335367
}

app/code/Magento/Catalog/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"magento/module-catalog-sample-data": "Sample Data version:100.0.*"
3535
},
3636
"type": "magento2-module",
37-
"version": "100.0.7",
37+
"version": "100.0.8",
3838
"license": [
3939
"OSL-3.0",
4040
"AFL-3.0"

app/code/Magento/CatalogImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"ext-ctype": "*"
1717
},
1818
"type": "magento2-module",
19-
"version": "100.0.6",
19+
"version": "100.0.7",
2020
"license": [
2121
"OSL-3.0",
2222
"AFL-3.0"

app/code/Magento/CatalogUrlRewrite/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"magento/framework": "100.0.*"
1414
},
1515
"type": "magento2-module",
16-
"version": "100.0.5",
16+
"version": "100.0.6",
1717
"license": [
1818
"OSL-3.0",
1919
"AFL-3.0"

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class Sidebar extends AbstractCart
1414
{
1515
/**
16-
* Xml pah to checkout sidebar count value
16+
* Xml pah to checkout sidebar display value
1717
*/
1818
const XML_PATH_CHECKOUT_SIDEBAR_DISPLAY = 'checkout/sidebar/display';
1919

@@ -63,7 +63,8 @@ public function getConfig()
6363
'updateItemQtyUrl' => $this->getUpdateItemQtyUrl(),
6464
'removeItemUrl' => $this->getRemoveItemUrl(),
6565
'imageTemplate' => $this->getImageHtmlTemplate(),
66-
'baseUrl' => $this->getBaseUrl()
66+
'baseUrl' => $this->getBaseUrl(),
67+
'minicartMaxItemsVisible' => $this->getMiniCartMaxItemsCount()
6768
];
6869
}
6970

@@ -171,4 +172,14 @@ public function getBaseUrl()
171172
{
172173
return $this->_storeManager->getStore()->getBaseUrl();
173174
}
175+
176+
/**
177+
* Return max visible item count for minicart
178+
*
179+
* @return int
180+
*/
181+
private function getMiniCartMaxItemsCount()
182+
{
183+
return (int)$this->_scopeConfig->getValue('checkout/sidebar/count', ScopeInterface::SCOPE_STORE);
184+
}
174185
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public function testGetConfig()
138138
'updateItemQtyUrl' => $updateItemQtyUrl,
139139
'removeItemUrl' => $removeItemUrl,
140140
'imageTemplate' => $imageTemplate,
141-
'baseUrl' => $baseUrl
141+
'baseUrl' => $baseUrl,
142+
'minicartMaxItemsVisible' => 3
142143
];
143144

144145
$valueMap = [
@@ -159,6 +160,13 @@ public function testGetConfig()
159160
$storeMock->expects($this->once())->method('getBaseUrl')->willReturn($baseUrl);
160161
$this->imageHelper->expects($this->once())->method('getFrame')->willReturn(false);
161162

163+
$this->scopeConfigMock->expects($this->once())
164+
->method('getValue')
165+
->with(
166+
'checkout/sidebar/count',
167+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
168+
)->willReturn(3);
169+
162170
$this->assertEquals($expectedResult, $this->model->getConfig());
163171
}
164172

app/code/Magento/Checkout/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"magento/module-cookie": "100.0.*"
2828
},
2929
"type": "magento2-module",
30-
"version": "100.0.6",
30+
"version": "100.0.7",
3131
"license": [
3232
"OSL-3.0",
3333
"AFL-3.0"

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/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ define([
1717
$.widget('mage.sidebar', {
1818
options: {
1919
isRecursive: true,
20-
maxItemsVisible: 3
20+
minicart: {
21+
maxItemsVisible: 3
22+
}
2123
},
2224
scrollHeight: 0,
2325

@@ -229,9 +231,10 @@ define([
229231
_calcHeight: function() {
230232
var self = this,
231233
height = 0,
232-
counter = this.options.maxItemsVisible,
234+
counter = this.options.minicart.maxItemsVisible,
233235
target = $(this.options.minicart.list);
234236

237+
self.scrollHeight = 0;
235238
target.children().each(function () {
236239
var outerHeight = $(this).outerHeight();
237240

@@ -241,7 +244,7 @@ define([
241244
self.scrollHeight += outerHeight;
242245
});
243246

244-
target.height(height);
247+
target.parent().height(height);
245248
}
246249
});
247250

0 commit comments

Comments
 (0)