Skip to content

Commit 78f8094

Browse files
committed
Merge branch '2.2-develop' of https://github.com/magento/magento2ce into MAGETWO-73537
2 parents db2efcb + 7d636a4 commit 78f8094

File tree

18 files changed

+346
-63
lines changed

18 files changed

+346
-63
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\ConfigurableProduct\Model\ResourceModel\Product;
7+
8+
use Magento\Catalog\Model\ResourceModel\Product\LinkedProductSelectBuilderInterface;
9+
10+
/**
11+
* Used in Magento\ConfigurableProduct\Pricing\Price\LowestPriceOptionsProvider
12+
* to provide queries to select configurable product option with lowest price
13+
*
14+
* @see app/code/Magento/ConfigurableProduct/etc/di.xml
15+
*/
16+
class LinkedProductSelectBuilderComposite implements LinkedProductSelectBuilderInterface
17+
{
18+
/**
19+
* @var LinkedProductSelectBuilderInterface[]
20+
*/
21+
private $linkedProductSelectBuilder;
22+
23+
/**
24+
* @param LinkedProductSelectBuilderInterface[] $linkedProductSelectBuilder
25+
*/
26+
public function __construct($linkedProductSelectBuilder)
27+
{
28+
$this->linkedProductSelectBuilder = $linkedProductSelectBuilder;
29+
}
30+
31+
/**
32+
* {@inheritdoc}
33+
*/
34+
public function build($productId)
35+
{
36+
$selects = [];
37+
foreach ($this->linkedProductSelectBuilder as $productSelectBuilder) {
38+
$selects = array_merge($selects, $productSelectBuilder->build($productId));
39+
}
40+
41+
return $selects;
42+
}
43+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@
189189
<argument name="productIndexer" xsi:type="object">Magento\Catalog\Model\Indexer\Product\Full</argument>
190190
</arguments>
191191
</type>
192+
<virtualType name="LinkedProductSelectBuilderByIndexMinPrice" type="Magento\ConfigurableProduct\Model\ResourceModel\Product\LinkedProductSelectBuilderComposite">
193+
<arguments>
194+
<argument name="linkedProductSelectBuilder" xsi:type="array">
195+
<item name="indexPrice" xsi:type="object">Magento\Catalog\Model\ResourceModel\Product\Indexer\LinkedProductSelectBuilderByIndexPrice</item>
196+
</argument>
197+
</arguments>
198+
</virtualType>
192199
<type name="Magento\ConfigurableProduct\Pricing\Price\LowestPriceOptionsProvider">
193200
<arguments>
194201
<argument name="linkedProductSelectBuilder" xsi:type="object">Magento\ConfigurableProduct\Model\ResourceModel\Product\LinkedProductSelectBuilder</argument>
@@ -197,6 +204,7 @@
197204
<type name="Magento\ConfigurableProduct\Model\ResourceModel\Product\LinkedProductSelectBuilder">
198205
<arguments>
199206
<argument name="baseSelectProcessor" xsi:type="object">Magento\ConfigurableProduct\Model\ResourceModel\Product\StockStatusBaseSelectProcessor</argument>
207+
<argument name="linkedProductSelectBuilder" xsi:type="object">LinkedProductSelectBuilderByIndexMinPrice</argument>
200208
</arguments>
201209
</type>
202210
<type name="Magento\Catalog\Model\Product\Pricing\Renderer\SalableResolver">

app/code/Magento/Directory/Model/Currency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function convert($price, $toCurrency = null)
225225
if ($toCurrency === null) {
226226
return $price;
227227
} elseif ($rate = $this->getRate($toCurrency)) {
228-
return $price * $rate;
228+
return floatval($price) * floatval($rate);
229229
}
230230

231231
throw new \Exception(__(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@
687687
<item name="shipping_address" xsi:type="object">ShippingAddressAggregator</item>
688688
<item name="shipping_information" xsi:type="string">sales_order.shipping_description</item>
689689
<item name="subtotal" xsi:type="string">sales_invoice.base_subtotal</item>
690-
<item name="shipping_and_handling" xsi:type="string">sales_order.base_shipping_amount</item>
690+
<item name="shipping_and_handling" xsi:type="string">sales_invoice.base_shipping_amount</item>
691691
<item name="base_grand_total" xsi:type="string">sales_invoice.base_grand_total</item>
692692
<item name="grand_total" xsi:type="string">sales_invoice.grand_total</item>
693693
<item name="created_at" xsi:type="string">sales_invoice.created_at</item>

app/code/Magento/Search/view/frontend/web/form-mini.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,17 @@ define([
206206

207207
switch (keyCode) {
208208
case $.ui.keyCode.HOME:
209-
this._getFirstVisibleElement().addClass(this.options.selectClass);
210-
this.responseList.selected = this._getFirstVisibleElement();
209+
if (this._getFirstVisibleElement()) {
210+
this._getFirstVisibleElement().addClass(this.options.selectClass);
211+
this.responseList.selected = this._getFirstVisibleElement();
212+
}
211213
break;
212214

213215
case $.ui.keyCode.END:
214-
this._getLastElement().addClass(this.options.selectClass);
215-
this.responseList.selected = this._getLastElement();
216+
if (this._getLastElement()) {
217+
this._getLastElement().addClass(this.options.selectClass);
218+
this.responseList.selected = this._getLastElement();
219+
}
216220
break;
217221

218222
case $.ui.keyCode.ESCAPE:

app/code/Magento/Sitemap/Model/Sitemap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ protected function _finalizeSitemap($type = self::TYPE_URL)
614614
*/
615615
protected function _getCurrentSitemapFilename($index)
616616
{
617-
return self::INDEX_FILE_PREFIX . '-' . $this->getStoreId() . '-' . $index . '.xml';
617+
return str_replace('.xml', '', $this->getSitemapFilename()) . '-' . $this->getStoreId() . '-' . $index . '.xml';
618618
}
619619

620620
/**

app/code/Magento/Swatches/view/adminhtml/web/js/visual.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ define([
143143
element.hide();
144144
this.totalItems--;
145145
this.updateItemsCountField();
146+
this.updateSortOrder();
146147
}
147148
},
148149

@@ -153,6 +154,17 @@ define([
153154
$('swatch-visual-option-count-check').value = this.totalItems > 0 ? '1' : '';
154155
},
155156

157+
/**
158+
* Update sort order values
159+
*/
160+
updateSortOrder: function () {
161+
jQuery('[data-role=swatch-visual-options-container] tr:not(.no-display) [data-role=order]').each(
162+
function (index, element) {
163+
jQuery(element).val(index + 1);
164+
}
165+
);
166+
},
167+
156168
/**
157169
* Enable delete button for new option
158170
*
@@ -267,11 +279,7 @@ define([
267279
* Update component
268280
*/
269281
update: function () {
270-
$('[data-role=swatch-visual-options-container] [data-role=order]').each(
271-
function (index, element) {
272-
$(element).val(index + 1);
273-
}
274-
);
282+
swatchVisualOption.updateSortOrder();
275283
}
276284
});
277285
});

app/code/Magento/Tax/view/frontend/web/js/view/checkout/summary/tax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ define([
6767
}
6868
}
6969

70-
return amount;
70+
return parseFloat(amount);
7171
},
7272

7373
/**

0 commit comments

Comments
 (0)