Skip to content

Commit c083e6b

Browse files
committed
Merge remote-tracking branch 'mainline/2.2-develop' into MC-16764
2 parents a318778 + 27207cf commit c083e6b

File tree

83 files changed

+1159
-1160
lines changed

Some content is hidden

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

83 files changed

+1159
-1160
lines changed

app/code/Magento/Checkout/view/frontend/templates/button.phtml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>
118

129
<?php if ($block->getCanViewOrder() && $block->getCanPrintOrder()) :?>
13-
<a href="<?= /* @escapeNotVerified */ $block->getPrintUrl() ?>" target="_blank" class="print">
14-
<?= /* @escapeNotVerified */ __('Print receipt') ?>
10+
<a href="<?= $block->escapeUrl($block->getPrintUrl()) ?>" target="_blank" class="print">
11+
<?= $block->escapeHtml(__('Print receipt')) ?>
1512
</a>
1613
<?= $block->getChildHtml() ?>
1714
<?php endif;?>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
*/
1313

1414
if ($block->getItemsCount()) {
15+
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
1516
echo $block->getChildHtml('with-items');
1617
} else {
18+
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
1719
echo $block->getChildHtml('no-items');
1820
}

app/code/Magento/Checkout/view/frontend/templates/cart/additional/info.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
?>
108
<?php
119
/**
1210
* Shopping cart additional info
1311
* @var $block \Magento\Framework\View\Element\Template
1412
*/
13+
14+
// phpcs:disable PSR2.Files.ClosingTag
1515
?>
1616
<?php
1717
$name = $block->getNameInLayout();
1818
foreach ($block->getChildNames($name) as $childName) {
19+
// phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput
1920
echo $block->getChildBlock($childName)->setItem($block->getItem())->toHtml();
2021
}
2122
?>

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

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
?>
10-
<div class="block discount" id="block-discount" data-mage-init='{"collapsible":{"openedState": "active", "saveState": false}}'>
8+
<div class="block discount"
9+
id="block-discount"
10+
data-mage-init='{"collapsible":{"openedState": "active", "saveState": false}}'
11+
>
1112
<div class="title" data-role="title">
12-
<strong id="block-discount-heading" role="heading" aria-level="2"><?= /* @escapeNotVerified */ __('Apply Discount Code') ?></strong>
13+
<strong id="block-discount-heading" role="heading" aria-level="2"><?= $block->escapeHtml(__('Apply Discount Code')) ?></strong>
1314
</div>
1415
<div class="content" data-role="content" aria-labelledby="block-discount-heading">
1516
<form id="discount-coupon-form"
16-
action="<?= /* @escapeNotVerified */ $block->getUrl('checkout/cart/couponPost') ?>"
17+
action="<?= $block->escapeUrl($block->getUrl('checkout/cart/couponPost')) ?>"
1718
method="post"
1819
data-mage-init='{"discountCode":{"couponCodeSelector": "#coupon_code",
1920
"removeCouponSelector": "#remove-coupon",
@@ -22,21 +23,30 @@
2223
<div class="fieldset coupon<?= strlen($block->getCouponCode()) ? ' applied' : '' ?>">
2324
<input type="hidden" name="remove" id="remove-coupon" value="0" />
2425
<div class="field">
25-
<label for="coupon_code" class="label"><span><?= /* @escapeNotVerified */ __('Enter discount code') ?></span></label>
26+
<label for="coupon_code" class="label"><span><?= $block->escapeHtml(__('Enter discount code')) ?></span></label>
2627
<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')) ?>" <?php if (strlen($block->getCouponCode())): ?> disabled="disabled" <?php endif; ?> />
28+
<input type="text"
29+
class="input-text"
30+
id="coupon_code"
31+
name="coupon_code"
32+
value="<?= $block->escapeHtmlAttr($block->getCouponCode()) ?>"
33+
placeholder="<?= $block->escapeHtmlAttr(__('Enter discount code')) ?>"
34+
<?php if (strlen($block->getCouponCode())) :?>
35+
disabled="disabled"
36+
<?php endif; ?>
37+
/>
2838
</div>
2939
</div>
3040
<div class="actions-toolbar">
31-
<?php if (!strlen($block->getCouponCode())): ?>
41+
<?php if (!strlen($block->getCouponCode())) :?>
3242
<div class="primary">
33-
<button class="action apply primary" type="button" value="<?= /* @escapeNotVerified */ __('Apply Discount') ?>">
34-
<span><?= /* @escapeNotVerified */ __('Apply Discount') ?></span>
43+
<button class="action apply primary" type="button" value="<?= $block->escapeHtmlAttr(__('Apply Discount')) ?>">
44+
<span><?= $block->escapeHtml(__('Apply Discount')) ?></span>
3545
</button>
3646
</div>
37-
<?php else: ?>
47+
<?php else :?>
3848
<div class="primary">
39-
<button type="button" class="action cancel primary" value="<?= /* @escapeNotVerified */ __('Cancel Coupon') ?>"><span><?= /* @escapeNotVerified */ __('Cancel Coupon') ?></span></button>
49+
<button type="button" class="action cancel primary" value="<?= $block->escapeHtmlAttr(__('Cancel Coupon')) ?>"><span><?= $block->escapeHtml(__('Cancel Coupon')) ?></span></button>
4050
</div>
4151
<?php endif; ?>
4252
</div>

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

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,56 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
88

99
/** @var $block \Magento\Checkout\Block\Cart\Grid */
1010
?>
11-
<?php $mergedCells = ($this->helper('Magento\Tax\Helper\Data')->displayCartBothPrices() ? 2 : 1); ?>
11+
<?php $mergedCells = ($this->helper(Magento\Tax\Helper\Data::class)->displayCartBothPrices() ? 2 : 1); ?>
1212
<?= $block->getChildHtml('form_before') ?>
13-
<form action="<?= /* @escapeNotVerified */ $block->getUrl('checkout/cart/updatePost') ?>"
13+
<form action="<?= $block->escapeUrl($block->getUrl('checkout/cart/updatePost')) ?>"
1414
method="post"
1515
id="form-validate"
1616
data-mage-init='{"Magento_Checkout/js/action/update-shopping-cart":
17-
{"validationURL" : "<?= /* @escapeNotVerified */ $block->getUrl('checkout/cart/updateItemQty') ?>",
17+
{"validationURL" : "<?= $block->escapeUrl($block->getUrl('checkout/cart/updateItemQty')) ?>",
1818
"updateCartActionContainer": "#update_cart_action_container"}
1919
}'
2020
class="form form-cart">
2121
<?= $block->getBlockHtml('formkey') ?>
2222
<div class="cart table-wrapper<?= $mergedCells == 2 ? ' detailed' : '' ?>">
23-
<?php if ($block->getPagerHtml()): ?>
24-
<div class="cart-products-toolbar cart-products-toolbar-top toolbar" data-attribute="cart-products-toolbar-top"><?= $block->getPagerHtml() ?></div>
23+
<?php if ($block->getPagerHtml()) :?>
24+
<div class="cart-products-toolbar cart-products-toolbar-top toolbar"
25+
data-attribute="cart-products-toolbar-top"><?= $block->getPagerHtml() ?>
26+
</div>
2527
<?php endif ?>
2628
<table id="shopping-cart-table"
2729
class="cart items data table"
2830
data-mage-init='{"shoppingCart":{"emptyCartButton": ".action.clear",
2931
"updateCartActionContainer": "#update_cart_action_container"}}'>
30-
<caption class="table-caption"><?= /* @escapeNotVerified */ __('Shopping Cart Items') ?></caption>
32+
<caption class="table-caption"><?= $block->escapeHtml(__('Shopping Cart Items')) ?></caption>
3133
<thead>
3234
<tr>
33-
<th class="col item" scope="col"><span><?= /* @escapeNotVerified */ __('Item') ?></span></th>
34-
<th class="col price" scope="col"><span><?= /* @escapeNotVerified */ __('Price') ?></span></th>
35-
<th class="col qty" scope="col"><span><?= /* @escapeNotVerified */ __('Qty') ?></span></th>
36-
<th class="col subtotal" scope="col"><span><?= /* @escapeNotVerified */ __('Subtotal') ?></span></th>
35+
<th class="col item" scope="col"><span><?= $block->escapeHtml(__('Item')) ?></span></th>
36+
<th class="col price" scope="col"><span><?= $block->escapeHtml(__('Price')) ?></span></th>
37+
<th class="col qty" scope="col"><span><?= $block->escapeHtml(__('Qty')) ?></span></th>
38+
<th class="col subtotal" scope="col"><span><?= $block->escapeHtml(__('Subtotal')) ?></span></th>
3739
</tr>
3840
</thead>
39-
<?php foreach ($block->getItems() as $_item): ?>
41+
<?php foreach ($block->getItems() as $_item) :?>
4042
<?= $block->getItemHtml($_item) ?>
4143
<?php endforeach ?>
4244
</table>
43-
<?php if ($block->getPagerHtml()): ?>
44-
<div class="cart-products-toolbar cart-products-toolbar-bottom toolbar" data-attribute="cart-products-toolbar-bottom"><?= $block->getPagerHtml() ?></div>
45+
<?php if ($block->getPagerHtml()) :?>
46+
<div class="cart-products-toolbar cart-products-toolbar-bottom toolbar"
47+
data-attribute="cart-products-toolbar-bottom"><?= $block->getPagerHtml() ?>
48+
</div>
4549
<?php endif ?>
4650
</div>
4751
<div class="cart main actions">
48-
<?php if ($block->getContinueShoppingUrl()): ?>
52+
<?php if ($block->getContinueShoppingUrl()) :?>
4953
<a class="action continue"
5054
href="<?= $block->escapeUrl($block->getContinueShoppingUrl()) ?>"
5155
title="<?= $block->escapeHtml(__('Continue Shopping')) ?>">
52-
<span><?= /* @escapeNotVerified */ __('Continue Shopping') ?></span>
56+
<span><?= $block->escapeHtml(__('Continue Shopping')) ?></span>
5357
</a>
5458
<?php endif; ?>
5559
<button type="submit"
@@ -58,15 +62,15 @@
5862
value="empty_cart"
5963
title="<?= $block->escapeHtml(__('Clear Shopping Cart')) ?>"
6064
class="action clear" id="empty_cart_button">
61-
<span><?= /* @escapeNotVerified */ __('Clear Shopping Cart') ?></span>
65+
<span><?= $block->escapeHtml(__('Clear Shopping Cart')) ?></span>
6266
</button>
6367
<button type="submit"
6468
name="update_cart_action"
6569
data-cart-item-update=""
6670
value="update_qty"
6771
title="<?= $block->escapeHtml(__('Update Shopping Cart')) ?>"
6872
class="action update">
69-
<span><?= /* @escapeNotVerified */ __('Update Shopping Cart') ?></span>
73+
<span><?= $block->escapeHtml(__('Update Shopping Cart')) ?></span>
7074
</button>
7175
<input type="hidden" value="" id="update_cart_action_container" data-cart-item-update=""/>
7276
</div>

app/code/Magento/Checkout/view/frontend/templates/cart/item/configure/updatecart.phtml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,34 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/** @var $block \Magento\Catalog\Block\Product\View */
108
?>
119
<?php $_product = $block->getProduct(); ?>
1210
<?php $buttonTitle = __('Update Cart'); ?>
13-
<?php if ($_product->isSaleable()): ?>
11+
<?php if ($_product->isSaleable()) :?>
1412
<div class="box-tocart update">
1513
<fieldset class="fieldset">
16-
<?php if ($block->shouldRenderQuantity()): ?>
14+
<?php if ($block->shouldRenderQuantity()) :?>
1715
<div class="field qty">
18-
<label class="label" for="qty"><span><?= /* @escapeNotVerified */ __('Qty') ?></span></label>
16+
<label class="label" for="qty"><span><?= $block->escapeHtml(__('Qty')) ?></span></label>
1917
<div class="control">
2018
<input type="number"
2119
name="qty"
2220
id="qty"
2321
min="0"
2422
value=""
25-
title="<?= /* @escapeNotVerified */ __('Qty') ?>"
23+
title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
2624
class="input-text qty"
2725
data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"/>
2826
</div>
2927
</div>
3028
<?php endif; ?>
3129
<div class="actions">
3230
<button type="submit"
33-
title="<?= /* @escapeNotVerified */ $buttonTitle ?>"
31+
title="<?= $block->escapeHtmlAttr($buttonTitle) ?>"
3432
class="action primary tocart"
3533
id="product-updatecart-button">
36-
<span><?= /* @escapeNotVerified */ $buttonTitle ?></span>
34+
<span><?= $block->escapeHtml($buttonTitle) ?></span>
3735
</button>
3836
<?= $block->getChildHtml('', true) ?>
3937
</div>

0 commit comments

Comments
 (0)