Skip to content

Commit 4ebe3f1

Browse files
authored
Merge pull request #343 from adobe-commerce-tier-4/PR-2024-07-11
[Support Tier-4 aplapana] 07-11-2024 Regular delivery of bugfixes and improvements
2 parents bdc2e1a + 1df0d32 commit 4ebe3f1

File tree

1 file changed

+19
-14
lines changed
  • app/code/Magento/PageBuilder/view/frontend/templates/catalog/product/widget/content

1 file changed

+19
-14
lines changed

app/code/Magento/PageBuilder/view/frontend/templates/catalog/product/widget/content/carousel.phtml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ use Magento\Framework\App\Action\Action;
3434
<?php foreach ($items as $_item): ?>
3535
<?= /* @noEscape */ ($iterator++ == 1) ? '<li class="product-item">' : '</li><li class="product-item">' ?>
3636
<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">
3838
<?= $block->getImage($_item, $image)->toHtml() ?>
3939
</a>
4040
<div class="product-item-details">
4141
<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)) ?>"
4444
class="product-item-link">
45-
<?= $block->escapeHtml($_item->getName()) ?>
45+
<?= $escaper->escapeHtml($_item->getName()) ?>
4646
</a>
4747
</strong>
4848
<?php if ($templateType): ?>
@@ -60,14 +60,19 @@ use Magento\Framework\App\Action\Action;
6060
<div class="actions-primary">
6161
<?php if ($_item->isSaleable()): ?>
6262
<?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']) ?>">
6570
<input type="hidden" name="<?= /* @noEscape */ Action::PARAM_NAME_URL_ENCODED ?>" value="<?= /* @noEscape */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED] ?>">
6671
<?= $block->getBlockHtml('formkey') ?>
6772
<button type="submit"
68-
title="<?= $block->escapeHtml(__('Add to Cart')) ?>"
73+
title="<?= $escaper->escapeHtml(__('Add to Cart')) ?>"
6974
class="action tocart primary">
70-
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
75+
<span><?= $escaper->escapeHtml(__('Add to Cart')) ?></span>
7176
</button>
7277
</form>
7378
<script type="text/x-magento-init">
@@ -81,9 +86,9 @@ use Magento\Framework\App\Action\Action;
8186
</script>
8287
<?php else: ?>
8388
<?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>
8590
<?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>
8792
<?php endif; ?>
8893
<?php endif; ?>
8994
</div>
@@ -92,14 +97,14 @@ use Magento\Framework\App\Action\Action;
9297
<div class="actions-secondary" data-role="add-to-links">
9398
<?php if ($this->helper(\Magento\Wishlist\Helper\Data::class)->isAllow() && $showWishlist): ?>
9499
<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>
97102
</a>
98103
<?php endif; ?>
99104
<?php if ($block->getAddToCompareUrl() && $showCompare): ?>
100105
<?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>
103108
</a>
104109
<?php endif; ?>
105110
</div>

0 commit comments

Comments
 (0)