Skip to content

Commit 7414ce7

Browse files
authored
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #13081: Fix for #11796 Magento2.2.0 home page product grid issues (by @punitv) - #13061: Fix for requireJS loading issues (for ad blockers) (by @Yonn-Trimoreau) - #13039: Feature minimum order amount notice issue (by @neeta-wagento) - #13030: Resolved Checkout-Payment-Wrong promo code cancelled issue (by @chiragp-wagento) - #12965: Fix vault_payment_token install script type where column defaults were not set (by @helloitsluke) Fixed GitHub Issues: - #11796: Magento2.2.0 home page product grid issues (reported by @losetemp) has been fixed in #13081 by @punitv in 2.2-develop branch Related commits: 1. 8283526 2. 1a407e6 3. c0d59a8 4. 6181457 5. 15064d9 - #12828: Uncaught Error: Script error for: trackingCode error on every frontend page (reported by @poojawebkul) has been fixed in #13061 by @Yonn-Trimoreau in 2.2-develop branch Related commits: 1. 247fbea 2. 23a946b 3. 62b4b6d 4. 7843395 5. d826cb3
2 parents 46bc997 + bb53c2d commit 7414ce7

File tree

9 files changed

+93
-37
lines changed

9 files changed

+93
-37
lines changed

app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
<ol class="product-items <?= /* @noEscape */ $type ?>">
3636
<?php $iterator = 1; ?>
3737
<?php foreach ($items as $_item): ?>
38-
<?php if ($iterator++ != 1): ?></li><?php endif ?>
39-
<li class="product-item">
38+
<?= /* @noEscape */ ($iterator++ == 1) ? '<li class="product-item">' : '</li><li class="product-item">' ?>
4039
<div class="product-item-info">
4140
<a href="<?= $block->escapeUrl($block->getProductUrl($_item)) ?>" class="product-item-photo">
4241
<?= $block->getImage($_item, $image)->toHtml() ?>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class="field">
2525
<label for="coupon_code" class="label"><span><?= /* @escapeNotVerified */ __('Enter discount code') ?></span></label>
2626
<div class="control">
27-
<input type="text" class="input-text" id="coupon_code" name="coupon_code" value="<?= $block->escapeHtml($block->getCouponCode()) ?>" placeholder="<?= $block->escapeHtml(__('Enter discount code')) ?>" />
27+
<input type="text" class="input-text" id="coupon_code" name="coupon_code" value="<?= $block->escapeHtml($block->getCouponCode()) ?>" placeholder="<?= $block->escapeHtml(__('Enter discount code')) ?>" <?php if (strlen($block->getCouponCode())): ?> disabled="disabled" <?php endif; ?> />
2828
</div>
2929
</div>
3030
<div class="actions-toolbar">

app/code/Magento/Quote/Model/Quote/Validator/MinimumOrderAmount/ValidationMessage.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,32 @@ class ValidationMessage
1919

2020
/**
2121
* @var \Magento\Framework\Locale\CurrencyInterface
22+
* @deprecated since 101.0.0
2223
*/
2324
private $currency;
2425

26+
/**
27+
* @var \Magento\Framework\Pricing\Helper\Data
28+
*/
29+
private $priceHelper;
30+
2531
/**
2632
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
2733
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
2834
* @param \Magento\Framework\Locale\CurrencyInterface $currency
35+
* @param \Magento\Framework\Pricing\Helper\Data $priceHelper
2936
*/
3037
public function __construct(
3138
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
3239
\Magento\Store\Model\StoreManagerInterface $storeManager,
33-
\Magento\Framework\Locale\CurrencyInterface $currency
40+
\Magento\Framework\Locale\CurrencyInterface $currency,
41+
\Magento\Framework\Pricing\Helper\Data $priceHelper = null
3442
) {
3543
$this->scopeConfig = $scopeConfig;
3644
$this->storeManager = $storeManager;
3745
$this->currency = $currency;
46+
$this->priceHelper = $priceHelper ?: \Magento\Framework\App\ObjectManager::getInstance()
47+
->get(\Magento\Framework\Pricing\Helper\Data::class);
3848
}
3949

4050
/**
@@ -50,13 +60,11 @@ public function getMessage()
5060
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
5161
);
5262
if (!$message) {
53-
$currencyCode = $this->storeManager->getStore()->getCurrentCurrencyCode();
54-
$minimumAmount = $this->currency->getCurrency($currencyCode)->toCurrency(
55-
$this->scopeConfig->getValue(
56-
'sales/minimum_order/amount',
57-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
58-
)
59-
);
63+
$minimumAmount = $this->priceHelper->currency($this->scopeConfig->getValue(
64+
'sales/minimum_order/amount',
65+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
66+
), true, false);
67+
6068
$message = __('Minimum order amount is %1', $minimumAmount);
6169
} else {
6270
//Added in order to address the issue: https://github.com/magento/magento2/issues/8287

app/code/Magento/Quote/Test/Unit/Model/Quote/Validator/MinimumOrderAmount/ValidationMessageTest.php

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,34 @@ class ValidationMessageTest extends \PHPUnit\Framework\TestCase
2626

2727
/**
2828
* @var \PHPUnit_Framework_MockObject_MockObject
29+
* @deprecated since 101.0.0
2930
*/
3031
private $currencyMock;
3132

33+
/**
34+
* @var \PHPUnit_Framework_MockObject_MockObject
35+
*/
36+
private $priceHelperMock;
37+
3238
protected function setUp()
3339
{
3440
$this->scopeConfigMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
3541
$this->storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class);
3642
$this->currencyMock = $this->createMock(\Magento\Framework\Locale\CurrencyInterface::class);
43+
$this->priceHelperMock = $this->createMock(\Magento\Framework\Pricing\Helper\Data::class);
3744

3845
$this->model = new \Magento\Quote\Model\Quote\Validator\MinimumOrderAmount\ValidationMessage(
3946
$this->scopeConfigMock,
4047
$this->storeManagerMock,
41-
$this->currencyMock
48+
$this->currencyMock,
49+
$this->priceHelperMock
4250
);
4351
}
4452

4553
public function testGetMessage()
4654
{
4755
$minimumAmount = 20;
4856
$minimumAmountCurrency = '$20';
49-
$currencyCode = 'currency_code';
50-
5157
$this->scopeConfigMock->expects($this->at(0))
5258
->method('getValue')
5359
->with('sales/minimum_order/description', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)
@@ -58,27 +64,13 @@ public function testGetMessage()
5864
->with('sales/minimum_order/amount', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)
5965
->willReturn($minimumAmount);
6066

61-
$storeMock = $this->createPartialMock(\Magento\Store\Model\Store::class, ['getCurrentCurrencyCode']);
62-
$storeMock->expects($this->once())->method('getCurrentCurrencyCode')->willReturn($currencyCode);
63-
$this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($storeMock);
67+
$this->priceHelperMock->expects($this->once())
68+
->method('currency')
69+
->with($minimumAmount, true, false)
70+
->will($this->returnValue($minimumAmountCurrency));
6471

65-
$currencyMock = $this->createMock(\Magento\Framework\Currency::class);
66-
$this->currencyMock->expects($this->once())
67-
->method('getCurrency')
68-
->with($currencyCode)
69-
->willReturn($currencyMock);
70-
71-
$currencyMock->expects($this->once())
72-
->method('toCurrency')
73-
->with($minimumAmount)
74-
->willReturn($minimumAmountCurrency);
75-
76-
$this->assertEquals(
77-
__('Minimum order amount is %1', $minimumAmountCurrency),
78-
$this->model->getMessage()
79-
);
72+
$this->assertEquals(__('Minimum order amount is %1', $minimumAmountCurrency), $this->model->getMessage());
8073
}
81-
8274
public function testGetConfigMessage()
8375
{
8476
$configMessage = 'config_message';

app/code/Magento/SalesRule/view/frontend/web/template/payment/discount.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
id="discount-code"
2828
name="discount_code"
2929
data-validate="{'required-entry':true}"
30-
data-bind="value: couponCode, attr:{placeholder: $t('Enter discount code')} " />
30+
data-bind="value: couponCode, attr:{disabled:isApplied() , placeholder: $t('Enter discount code')} " />
3131
</div>
3232
</div>
3333
</div>

app/code/Magento/Vault/Setup/InstallSchema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
9090
'is_active',
9191
Table::TYPE_BOOLEAN,
9292
null,
93-
['nullable' => false, 'dafault' => true],
93+
['nullable' => false, 'default' => true],
9494
'Is active flag'
9595
)->addColumn(
9696
'is_visible',
9797
Table::TYPE_BOOLEAN,
9898
null,
99-
['nullable' => false, 'dafault' => true],
99+
['nullable' => false, 'default' => true],
100100
'Is visible flag'
101101
)->addIndex(
102102
$setup->getIdxName(
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Vault\Setup;
8+
9+
use Magento\Framework\Setup\ModuleContextInterface;
10+
use Magento\Framework\Setup\SchemaSetupInterface;
11+
use Magento\Framework\Setup\UpgradeSchemaInterface;
12+
use Magento\Framework\DB\Ddl\Table;
13+
14+
/**
15+
* Upgrade the Vault module DB scheme
16+
*/
17+
class UpgradeSchema implements UpgradeSchemaInterface
18+
{
19+
/**
20+
* @inheritdoc
21+
*/
22+
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
23+
{
24+
$setup->startSetup();
25+
if (version_compare($context->getVersion(), '2.0.3', '<')) {
26+
$this->upgradeTokenTableDefaultValues($setup);
27+
}
28+
$setup->endSetup();
29+
}
30+
31+
/**
32+
* @param SchemaSetupInterface $setup
33+
* @return void
34+
*/
35+
private function upgradeTokenTableDefaultValues(SchemaSetupInterface $setup)
36+
{
37+
$columns = ['is_active', 'is_visible'];
38+
39+
foreach ($columns as $columnName) {
40+
$setup->getConnection()->modifyColumn(
41+
$setup->getTable(InstallSchema::PAYMENT_TOKEN_TABLE),
42+
$columnName,
43+
[
44+
'type' => Table::TYPE_BOOLEAN,
45+
'nullable' => false,
46+
'default' => '1'
47+
]
48+
);
49+
}
50+
}
51+
}

app/code/Magento/Vault/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Vault" setup_version="2.0.2">
9+
<module name="Magento_Vault" setup_version="2.0.3">
1010
<sequence>
1111
<module name="Magento_Sales"/>
1212
<module name="Magento_Store"/>

lib/web/mage/apply/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ define([
3232
} else if ($(el)[component]) {
3333
$(el)[component](config);
3434
}
35+
}, function (error) {
36+
if ('console' in window && typeof window.console.error === 'function') {
37+
console.error(error);
38+
}
39+
40+
return true;
3541
});
3642
}
3743

0 commit comments

Comments
 (0)