Skip to content

Commit 58ea689

Browse files
author
Hwashiang Yu
committed
Merge remote-tracking branch 'upstream/2.3-develop' into MAGETWO-56444
2 parents 1f82012 + faf4db0 commit 58ea689

File tree

21 files changed

+207
-42
lines changed

21 files changed

+207
-42
lines changed

app/code/Magento/AdvancedSearch/view/adminhtml/web/js/testconnection.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ define([
4040
element = $('#' + this.options.elementId),
4141
self = this,
4242
params = {},
43-
msg = '';
43+
msg = '',
44+
fieldToCheck = this.options.fieldToCheck || 'success';
4445

4546
element.removeClass('success').addClass('fail');
4647
$.each($.parseJSON(this.options.fieldMapping), function (key, el) {
@@ -49,9 +50,10 @@ define([
4950
$.ajax({
5051
url: this.options.url,
5152
showLoader: true,
52-
data: params
53+
data: params,
54+
headers: this.options.headers || {}
5355
}).done(function (response) {
54-
if (response.success) {
56+
if (response[fieldToCheck]) {
5557
element.removeClass('fail').addClass('success');
5658
result = self.options.successText;
5759
} else {

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,8 @@ public function getQuery(array $dimensions, string $productType, array $entityId
221221
$select->where("e.type_id = ?", $productType);
222222

223223
if ($entityIds !== null) {
224-
if (count($entityIds) > 1) {
225-
$select->where(sprintf('e.entity_id BETWEEN %s AND %s', min($entityIds), max($entityIds)));
226-
} else {
227-
$select->where('e.entity_id = ?', $entityIds);
228-
}
224+
$select->where(sprintf('e.entity_id BETWEEN %s AND %s', min($entityIds), max($entityIds)));
225+
$select->where('e.entity_id IN(?)', $entityIds);
229226
}
230227

231228
/**

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Catalog\Pricing\Render;
79

810
use Magento\Catalog\Model\Product;
@@ -71,7 +73,9 @@ public function jsonEncode($valueToEncode)
7173
*
7274
* @param int $length
7375
* @param string|null $chars
76+
*
7477
* @return string
78+
* @throws \Magento\Framework\Exception\LocalizedException
7579
*/
7680
public function getRandomString($length, $chars = null)
7781
{
@@ -93,4 +97,21 @@ public function getCanDisplayQty(Product $product)
9397
}
9498
return true;
9599
}
100+
101+
/**
102+
* Format percent
103+
*
104+
* @param float $percent
105+
*
106+
* @return string
107+
*/
108+
public function formatPercent(float $percent): string
109+
{
110+
/*First rtrim - trim zeros. So, 10.00 -> 10.*/
111+
/*Second rtrim - trim dot. So, 10. -> 10*/
112+
return rtrim(
113+
rtrim(number_format($percent, 2), '0'),
114+
'.'
115+
);
116+
}
96117
}

app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,6 @@
192192
<label translate="true">Websites</label>
193193
</settings>
194194
</column>
195-
<column name="cost" class="Magento\Catalog\Ui\Component\Listing\Columns\Price" sortOrder="120">
196-
<settings>
197-
<addField>true</addField>
198-
<filter>textRange</filter>
199-
<label translate="true">Cost</label>
200-
</settings>
201-
</column>
202195
<actionsColumn name="actions" class="Magento\Catalog\Ui\Component\Listing\Columns\ProductActions" sortOrder="200">
203196
<settings>
204197
<indexField>entity_id</indexField>

app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ $product = $block->getSaleableItem();
7777
$price['price_qty'],
7878
$priceAmountBlock,
7979
$index,
80-
$tierPriceModel->getSavePercent($price['price'])
80+
$block->formatPercent($price['percentage_value'] ?? $tierPriceModel->getSavePercent($price['price']))
8181
)
8282
: __('Buy %1 for %2 each', $price['price_qty'], $priceAmountBlock);
8383
?>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<element name="orderLink" type="text" selector="a[href*=order_id].order-number" timeout="30"/>
1717
<element name="orderNumberText" type="text" selector=".checkout-success > p:nth-child(1)"/>
1818
<element name="continueShoppingButton" type="button" selector=".action.primary.continue" timeout="30"/>
19-
<element name="createAnAccount" type="button" selector="input[value='Create an Account']" timeout="30"/>
19+
<element name="createAnAccount" type="button" selector="[data-bind*=&quot;i18n: 'Create an Account'&quot;]" timeout="30"/>
2020
<element name="printLink" type="button" selector=".print" timeout="30"/>
2121
</section>
2222
</sections>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessRegisterSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<section name="CheckoutSuccessRegisterSection">
1212
<element name="registerMessage" type="text" selector="#registration p:nth-child(1)"/>
1313
<element name="customerEmail" type="text" selector="#registration p:nth-child(2)"/>
14-
<element name="createAccountButton" type="button" selector="#registration form input[type='submit']" timeout="30"/>
14+
<element name="createAccountButton" type="button" selector="[data-bind*=&quot;i18n: 'Create an Account'&quot;]" timeout="30"/>
1515
<element name="orderNumber" type="text" selector="//p[text()='Your order # is: ']//span"/>
1616
</section>
1717
</sections>

app/code/Magento/Checkout/view/frontend/templates/cart/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
method="post"
1515
id="form-validate"
1616
data-mage-init='{"Magento_Checkout/js/action/update-shopping-cart":
17-
{"validationURL" : "/checkout/cart/updateItemQty",
17+
{"validationURL" : "<?= /* @escapeNotVerified */ $block->getUrl('checkout/cart/updateItemQty') ?>",
1818
"updateCartActionContainer": "#update_cart_action_container"}
1919
}'
2020
class="form form-cart">

app/code/Magento/Checkout/view/frontend/web/template/registration.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<!-- ko if: isFormVisible -->
1212
<p data-bind="i18n: 'You can track your order status by creating an account.'"></p>
1313
<p><span data-bind="i18n: 'Email Address'"></span>: <span data-bind="text: getEmailAddress()"></span></p>
14-
<form method="get" data-bind="attr: { action: getUrl() }">
15-
<input type="submit" class="action primary" data-bind="value: $t('Create an Account')" />
16-
</form>
14+
<a class="action primary" data-bind="attr: { href: getUrl() }">
15+
<span data-bind="i18n: 'Create an Account'" />
16+
</a>
1717
<!--/ko-->
1818
</div>

app/code/Magento/ConfigurableImportExport/Model/Import/Product/Type/Configurable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ protected function _parseVariations($rowData)
596596
$additionalRow['_super_attribute_position'] = $position;
597597
$additionalRows[] = $additionalRow;
598598
$additionalRow = [];
599-
$position += 1;
599+
$position ++;
600600
}
601601
} else {
602602
throw new LocalizedException(
@@ -937,7 +937,7 @@ public function isRowValid(array $rowData, $rowNum, $isNewProduct = true)
937937
}
938938
foreach ($dataWithExtraVirtualRows as $option) {
939939
if (isset($option['_super_products_sku'])) {
940-
if (in_array($option['_super_products_sku'], $skus)) {
940+
if (in_array($option['_super_products_sku'], $skus, true)) {
941941
$error = true;
942942
$this->_entityModel->addRowError(
943943
sprintf(

0 commit comments

Comments
 (0)