@@ -34,15 +34,15 @@ use Magento\Framework\App\Action\Action;
34
34
<?php foreach ($ items as $ _item ): ?>
35
35
<?= /* @noEscape */ ($ iterator ++ == 1 ) ? '<li class="product-item"> ' : '</li><li class="product-item"> ' ?>
36
36
<div class="product-item-info">
37
- <a href="<?= $ block ->escapeUrl ($ block ->getProductUrl ($ _item )) ?> " class="product-item-photo">
37
+ <a href="<?= $ escaper ->escapeUrl ($ block ->getProductUrl ($ _item )) ?> " class="product-item-photo">
38
38
<?= $ block ->getImage ($ _item , $ image )->toHtml () ?>
39
39
</a>
40
40
<div class="product-item-details">
41
41
<strong class="product-item-name">
42
- <a title="<?= $ block ->escapeHtml ($ _item ->getName ()) ?> "
43
- href="<?= $ block ->escapeUrl ($ block ->getProductUrl ($ _item )) ?> "
42
+ <a title="<?= $ escaper ->escapeHtml ($ _item ->getName ()) ?> "
43
+ href="<?= $ escaper ->escapeUrl ($ block ->getProductUrl ($ _item )) ?> "
44
44
class="product-item-link">
45
- <?= $ block ->escapeHtml ($ _item ->getName ()) ?>
45
+ <?= $ escaper ->escapeHtml ($ _item ->getName ()) ?>
46
46
</a>
47
47
</strong>
48
48
<?php if ($ templateType ): ?>
@@ -60,14 +60,19 @@ use Magento\Framework\App\Action\Action;
60
60
<div class="actions-primary">
61
61
<?php if ($ _item ->isSaleable ()): ?>
62
62
<?php $ postParams = $ block ->getAddToCartPostParams ($ _item ); ?>
63
- <form data-role="tocart-form" data-product-sku="<?= $ block ->escapeHtml ($ _item ->getSku ()) ?> " action="<?= $ block ->escapeUrl ($ postParams ['action ' ]) ?> " method="post">
64
- <input type="hidden" name="product" value="<?= $ block ->escapeHtmlAttr ($ postParams ['data ' ]['product ' ]) ?> ">
63
+ <form data-role="tocart-form" data-product-sku="<?= $ escaper ->escapeHtml ($ _item ->getSku ()) ?> " action="<?= $ escaper ->escapeUrl ($ postParams ['action ' ]) ?> " method="post">
64
+ <?php foreach ($ postParams ['data ' ]['options ' ] as $ optionItem ): ?>
65
+ <input type="hidden"
66
+ name="<?= $ escaper ->escapeHtml ($ optionItem ['name ' ]) ?> "
67
+ value="<?= $ escaper ->escapeHtml ($ optionItem ['value ' ]) ?> ">
68
+ <?php endforeach ; ?>
69
+ <input type="hidden" name="product" value="<?= $ escaper ->escapeHtmlAttr ($ postParams ['data ' ]['product ' ]) ?> ">
65
70
<input type="hidden" name="<?= /* @noEscape */ Action::PARAM_NAME_URL_ENCODED ?> " value="<?= /* @noEscape */ $ postParams ['data ' ][Action::PARAM_NAME_URL_ENCODED ] ?> ">
66
71
<?= $ block ->getBlockHtml ('formkey ' ) ?>
67
72
<button type="submit"
68
- title="<?= $ block ->escapeHtml (__ ('Add to Cart ' )) ?> "
73
+ title="<?= $ escaper ->escapeHtml (__ ('Add to Cart ' )) ?> "
69
74
class="action tocart primary">
70
- <span><?= $ block ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
75
+ <span><?= $ escaper ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
71
76
</button>
72
77
</form>
73
78
<script type="text/x-magento-init">
@@ -81,9 +86,9 @@ use Magento\Framework\App\Action\Action;
81
86
</script>
82
87
<?php else : ?>
83
88
<?php if ($ _item ->getIsSalable ()): ?>
84
- <div class="stock available"><span><?= $ block ->escapeHtml (__ ('In stock ' )) ?> </span></div>
89
+ <div class="stock available"><span><?= $ escaper ->escapeHtml (__ ('In stock ' )) ?> </span></div>
85
90
<?php else : ?>
86
- <div class="stock unavailable"><span><?= $ block ->escapeHtml (__ ('Out of stock ' )) ?> </span></div>
91
+ <div class="stock unavailable"><span><?= $ escaper ->escapeHtml (__ ('Out of stock ' )) ?> </span></div>
87
92
<?php endif ; ?>
88
93
<?php endif ; ?>
89
94
</div>
@@ -92,14 +97,14 @@ use Magento\Framework\App\Action\Action;
92
97
<div class="actions-secondary" data-role="add-to-links">
93
98
<?php if ($ this ->helper (\Magento \Wishlist \Helper \Data::class)->isAllow () && $ showWishlist ): ?>
94
99
<a href="#"
95
- data-post='<?= /* @noEscape */ $ block ->getAddToWishlistParams ($ _item ) ?> ' class="action towishlist" data-action="add-to-wishlist" title="<?= $ block ->escapeHtmlAttr (__ ('Add to Wish List ' )) ?> ">
96
- <span><?= $ block ->escapeHtml (__ ('Add to Wish List ' )) ?> </span>
100
+ data-post='<?= /* @noEscape */ $ block ->getAddToWishlistParams ($ _item ) ?> ' class="action towishlist" data-action="add-to-wishlist" title="<?= $ escaper ->escapeHtmlAttr (__ ('Add to Wish List ' )) ?> ">
101
+ <span><?= $ escaper ->escapeHtml (__ ('Add to Wish List ' )) ?> </span>
97
102
</a>
98
103
<?php endif ; ?>
99
104
<?php if ($ block ->getAddToCompareUrl () && $ showCompare ): ?>
100
105
<?php $ compareHelper = $ this ->helper (\Magento \Catalog \Helper \Product \Compare::class);?>
101
- <a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $ compareHelper ->getPostDataParams ($ _item ) ?> ' title="<?= $ block ->escapeHtmlAttr (__ ('Add to Compare ' )) ?> ">
102
- <span><?= $ block ->escapeHtml (__ ('Add to Compare ' )) ?> </span>
106
+ <a href="#" class="action tocompare" data-post='<?= /* @noEscape */ $ compareHelper ->getPostDataParams ($ _item ) ?> ' title="<?= $ escaper ->escapeHtmlAttr (__ ('Add to Compare ' )) ?> ">
107
+ <span><?= $ escaper ->escapeHtml (__ ('Add to Compare ' )) ?> </span>
103
108
</a>
104
109
<?php endif ; ?>
105
110
</div>
0 commit comments