@@ -13,14 +13,16 @@ use Magento\Framework\App\Action\Action;
13
13
* Product list template
14
14
*
15
15
* @var $block \Magento\Catalog\Block\Product\ListProduct
16
+ * @var \Magento\Framework\Escaper $escaper
16
17
*/
17
18
?>
18
19
<?php
19
20
$ _productCollection = $ block ->getLoadedProductCollection ();
21
+ /** @var \Magento\Catalog\Helper\Output $_helper */
20
22
$ _helper = $ this ->helper (Magento \Catalog \Helper \Output::class);
21
23
?>
22
24
<?php if (!$ _productCollection ->count ()) :?>
23
- <div class="message info empty"><div><?= $ block ->escapeHtml (__ ('We can \'t find products matching the selection. ' )) ?> </div></div>
25
+ <div class="message info empty"><div><?= $ escaper ->escapeHtml (__ ('We can \'t find products matching the selection. ' )) ?> </div></div>
24
26
<?php else :?>
25
27
<?= $ block ->getToolbarHtml () ?>
26
28
<?= $ block ->getAdditionalHtml () ?>
@@ -55,7 +57,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
55
57
}
56
58
?>
57
59
<?php // Product Image ?>
58
- <a href="<?= $ block ->escapeUrl ($ _product ->getProductUrl ()) ?> "
60
+ <a href="<?= $ escaper ->escapeUrl ($ _product ->getProductUrl ()) ?> "
59
61
class="product photo product-item-photo"
60
62
tabindex="-1">
61
63
<?= $ productImage ->toHtml () ?>
@@ -66,7 +68,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
66
68
?>
67
69
<strong class="product name product-item-name">
68
70
<a class="product-item-link"
69
- href="<?= $ block ->escapeUrl ($ _product ->getProductUrl ()) ?> ">
71
+ href="<?= $ escaper ->escapeUrl ($ _product ->getProductUrl ()) ?> ">
70
72
<?= /* @noEscape */ $ _helper ->productAttribute ($ _product , $ _product ->getName (), 'name ' ) ?>
71
73
</a>
72
74
</strong>
@@ -77,13 +79,13 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
77
79
<?php endif ; ?>
78
80
79
81
<div class="product-item-inner">
80
- <div class="product actions product-item-actions"<?= strpos ($ pos , $ viewMode . '-actions ' ) ? $ block ->escapeHtmlAttr ($ position ) : '' ?> >
81
- <div class="actions-primary"<?= strpos ($ pos , $ viewMode . '-primary ' ) ? $ block ->escapeHtmlAttr ($ position ) : '' ?> >
82
+ <div class="product actions product-item-actions"<?= strpos ($ pos , $ viewMode . '-actions ' ) ? $ escaper ->escapeHtmlAttr ($ position ) : '' ?> >
83
+ <div class="actions-primary"<?= strpos ($ pos , $ viewMode . '-primary ' ) ? $ escaper ->escapeHtmlAttr ($ position ) : '' ?> >
82
84
<?php if ($ _product ->isSaleable ()) :?>
83
85
<?php $ postParams = $ block ->getAddToCartPostParams ($ _product ); ?>
84
86
<form data-role="tocart-form"
85
- data-product-sku="<?= $ block ->escapeHtml ($ _product ->getSku ()) ?> "
86
- action="<?= $ block ->escapeUrl ($ postParams ['action ' ]) ?> "
87
+ data-product-sku="<?= $ escaper ->escapeHtml ($ _product ->getSku ()) ?> "
88
+ action="<?= $ escaper ->escapeUrl ($ postParams ['action ' ]) ?> "
87
89
method="post">
88
90
<input type="hidden"
89
91
name="product"
@@ -92,20 +94,20 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
92
94
value="<?= /* @noEscape */ $ postParams ['data ' ][Action::PARAM_NAME_URL_ENCODED ] ?> ">
93
95
<?= $ block ->getBlockHtml ('formkey ' ) ?>
94
96
<button type="submit"
95
- title="<?= $ block ->escapeHtmlAttr (__ ('Add to Cart ' )) ?> "
97
+ title="<?= $ escaper ->escapeHtmlAttr (__ ('Add to Cart ' )) ?> "
96
98
class="action tocart primary">
97
- <span><?= $ block ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
99
+ <span><?= $ escaper ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
98
100
</button>
99
101
</form>
100
102
<?php else :?>
101
103
<?php if ($ _product ->isAvailable ()) :?>
102
- <div class="stock available"><span><?= $ block ->escapeHtml (__ ('In stock ' )) ?> </span></div>
104
+ <div class="stock available"><span><?= $ escaper ->escapeHtml (__ ('In stock ' )) ?> </span></div>
103
105
<?php else :?>
104
- <div class="stock unavailable"><span><?= $ block ->escapeHtml (__ ('Out of stock ' )) ?> </span></div>
106
+ <div class="stock unavailable"><span><?= $ escaper ->escapeHtml (__ ('Out of stock ' )) ?> </span></div>
105
107
<?php endif ; ?>
106
108
<?php endif ; ?>
107
109
</div>
108
- <div data-role="add-to-links" class="actions-secondary"<?= strpos ($ pos , $ viewMode . '-secondary ' ) ? $ block ->escapeHtmlAttr ($ position ) : '' ?> >
110
+ <div data-role="add-to-links" class="actions-secondary"<?= strpos ($ pos , $ viewMode . '-secondary ' ) ? $ escaper ->escapeHtmlAttr ($ position ) : '' ?> >
109
111
<?php if ($ addToBlock = $ block ->getChildBlock ('addto ' )) :?>
110
112
<?= $ addToBlock ->setProduct ($ _product )->getChildHtml () ?>
111
113
<?php endif ; ?>
@@ -114,9 +116,9 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
114
116
<?php if ($ showDescription ) :?>
115
117
<div class="product description product-item-description">
116
118
<?= /* @noEscape */ $ _helper ->productAttribute ($ _product , $ _product ->getShortDescription (), 'short_description ' ) ?>
117
- <a href="<?= $ block ->escapeUrl ($ _product ->getProductUrl ()) ?> "
119
+ <a href="<?= $ escaper ->escapeUrl ($ _product ->getProductUrl ()) ?> "
118
120
title="<?= /* @noEscape */ $ _productNameStripped ?> "
119
- class="action more"><?= $ block ->escapeHtml (__ ('Learn More ' )) ?> </a>
121
+ class="action more"><?= $ escaper ->escapeHtml (__ ('Learn More ' )) ?> </a>
120
122
</div>
121
123
<?php endif ; ?>
122
124
</div>
@@ -132,7 +134,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
132
134
{
133
135
"[data-role=tocart-form], .form.map.checkout": {
134
136
"catalogAddToCart": {
135
- "product_sku": "<?= $ block ->escapeJs ($ _product ->getSku ()) ?> "
137
+ "product_sku": "<?= $ escaper ->escapeJs ($ _product ->getSku ()) ?> "
136
138
}
137
139
}
138
140
}
0 commit comments