Skip to content

Commit 0897100

Browse files
author
Sergey Nosov
committed
Merge remote-tracking branch 'origin/merchant_beta' into SUPEE-7227
2 parents 8d044f6 + 5011ce6 commit 0897100

File tree

12 files changed

+281
-38
lines changed

12 files changed

+281
-38
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,12 +1958,14 @@ protected function _saveStockItem()
19581958
} else {
19591959
$row['qty'] = 0;
19601960
}
1961-
$stockData[] = $row;
1961+
if (!isset($stockData[$rowData[self::COL_SKU]])) {
1962+
$stockData[$rowData[self::COL_SKU]] = $row;
1963+
}
19621964
}
19631965

19641966
// Insert rows
19651967
if (!empty($stockData)) {
1966-
$this->_connection->insertOnDuplicate($entityTable, $stockData);
1968+
$this->_connection->insertOnDuplicate($entityTable, array_values($stockData));
19671969
}
19681970

19691971
if ($productIdsToReindex) {

app/code/Magento/CatalogImportExport/Model/Import/Uploader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function move($fileName, $renameFileOff = false)
155155

156156
$filePath = $this->_directory->getRelativePath($this->getTmpDir() . '/' . $fileName);
157157
$this->_setUploadFile($filePath);
158-
$result = $this->save($this->getDestDir());
158+
$result = $this->save($this->_directory->getAbsolutePath($this->getDestDir()));
159159
$result['name'] = self::getCorrectFileName($result['name']);
160160
return $result;
161161
}

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/UploaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function setUp()
7171
->getMock();
7272

7373
$this->directoryMock = $this->getMockBuilder('\Magento\Framework\Filesystem\Directory\Writer')
74-
->setMethods(['writeFile', 'getRelativePath'])
74+
->setMethods(['writeFile', 'getRelativePath', 'getAbsolutePath'])
7575
->disableOriginalConstructor()
7676
->getMock();
7777

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
9+
<body>
10+
<referenceBlock name="minicart">
11+
<arguments>
12+
<argument name="jsLayout" xsi:type="array">
13+
<item name="components" xsi:type="array">
14+
<item name="minicart_content" xsi:type="array">
15+
<item name="children" xsi:type="array">
16+
<item name="subtotal.container" xsi:type="array">
17+
<item name="children" xsi:type="array">
18+
<item name="subtotal" xsi:type="array">
19+
<item name="children" xsi:type="array">
20+
<item name="subtotal.totals" xsi:type="array">
21+
<item name="children" xsi:type="array">
22+
<item name="subtotal.totals.msrp" xsi:type="array">
23+
<item name="component" xsi:type="string">Magento_Msrp/js/view/checkout/minicart/subtotal/totals</item>
24+
<item name="config" xsi:type="array">
25+
<item name="displayArea" xsi:type="string">minicart-subtotal-hidden</item>
26+
<item name="template" xsi:type="string">Magento_Msrp/checkout/minicart/subtotal/totals</item>
27+
</item>
28+
</item>
29+
</item>
30+
</item>
31+
</item>
32+
</item>
33+
</item>
34+
</item>
35+
</item>
36+
</item>
37+
</item>
38+
</argument>
39+
</arguments>
40+
</referenceBlock>
41+
</body>
42+
</page>

app/code/Magento/Msrp/view/frontend/layout/default.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Copyright © 2015 Magento. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
define([
6+
'Magento_Tax/js/view/checkout/minicart/subtotal/totals',
7+
'underscore'
8+
], function (Component, _) {
9+
'use strict';
10+
11+
return Component.extend({
12+
13+
/**
14+
* @override
15+
*/
16+
initialize: function () {
17+
this._super();
18+
this.displaySubtotal(this.isMsrpApplied(this.cart().items));
19+
this.cart.subscribe(function (updatedCart) {
20+
21+
this.displaySubtotal(this.isMsrpApplied(updatedCart.items));
22+
}, this);
23+
},
24+
25+
/**
26+
* Determine if subtotal should be hidden.
27+
* @param {Array} cartItems
28+
* @return {Boolean}
29+
*/
30+
isMsrpApplied: function (cartItems) {
31+
return !_.find(cartItems, function (item) {
32+
if (_.has(item, 'canApplyMsrp')) {
33+
return item.canApplyMsrp;
34+
}
35+
36+
return false;
37+
});
38+
}
39+
});
40+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<span class="mark msrp" data-bind="text: $t('Order total will be displayed before you submit the order')"></span>

app/code/Magento/Tax/view/frontend/web/js/view/checkout/minicart/subtotal/totals.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
* See COPYING.txt for license details.
44
*/
55
define([
6+
'ko',
67
'uiComponent',
78
'Magento_Customer/js/customer-data'
8-
], function (Component, customerData) {
9+
], function (ko, Component, customerData) {
910
'use strict';
1011

1112
return Component.extend({
13+
displaySubtotal: ko.observable(true),
14+
15+
/**
16+
* @override
17+
*/
1218
initialize: function () {
1319
this._super();
1420
this.cart = customerData.get('cart');

app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,28 @@
66
-->
77

88
<div class="amount price-container">
9-
<!-- ko if: display_cart_subtotal_excl_tax -->
10-
<span class="price-wrapper" data-bind="html: cart().subtotal_excl_tax"></span>
11-
<!-- /ko -->
9+
<!-- ko if: displaySubtotal() -->
10+
<!-- ko if: display_cart_subtotal_excl_tax -->
11+
<span class="price-wrapper" data-bind="html: cart().subtotal_excl_tax"></span>
12+
<!-- /ko -->
1213

13-
<!-- ko if: !display_cart_subtotal_excl_tax && display_subtotal_incl_tax -->
14-
<span class="price-wrapper" data-bind="html: cart().subtotal_incl_tax"></span>
15-
<!-- /ko -->
14+
<!-- ko if: !display_cart_subtotal_excl_tax && display_subtotal_incl_tax -->
15+
<span class="price-wrapper" data-bind="html: cart().subtotal_incl_tax"></span>
16+
<!-- /ko -->
1617

17-
<!-- ko if: !display_cart_subtotal_excl_tax && !display_subtotal_incl_tax -->
18-
<span class="price-wrapper price-including-tax"
19-
data-bind="attr: { 'data-label': $t('Incl. Tax') }, html: cart().subtotal_incl_tax">
20-
</span>
18+
<!-- ko if: !display_cart_subtotal_excl_tax && !display_subtotal_incl_tax -->
19+
<span class="price-wrapper price-including-tax"
20+
data-bind="attr: { 'data-label': $t('Incl. Tax') }, html: cart().subtotal_incl_tax">
21+
</span>
2122

22-
<span class="price-wrapper price-excluding-tax"
23-
data-bind="attr: { 'data-label': $t('Excl. Tax') }, html: cart().subtotal_excl_tax">
24-
</span>
23+
<span class="price-wrapper price-excluding-tax"
24+
data-bind="attr: { 'data-label': $t('Excl. Tax') }, html: cart().subtotal_excl_tax">
25+
</span>
26+
<!-- /ko -->
27+
<!-- /ko -->
28+
<!-- ko ifnot: displaySubtotal() -->
29+
<!-- ko foreach: getRegion('minicart-subtotal-hidden') -->
30+
<!-- ko template: getTemplate() --><!-- /ko -->
31+
<!-- /ko -->
2532
<!-- /ko -->
2633
</div>

app/code/Magento/Theme/view/base/requirejs-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var config = {
4141
"jquery/jquery.hashchange": "jquery/jquery.ba-hashchange.min",
4242
"prototype": "legacy-build.min",
4343
"jquery/jquery-storageapi": "jquery/jquery.storageapi.min",
44-
"text": "requirejs/text",
44+
"text": "mage/requirejs/text",
4545
"domReady": "requirejs/domReady",
4646
"ko": "ko/ko",
4747
"tinymce": "tiny_mce/tiny_mce_src"

0 commit comments

Comments
 (0)