Skip to content

Commit 124c941

Browse files
committed
ACP2E-703: Page refreshes when products are added to cart
1 parent a3c38c4 commit 124c941

File tree

1 file changed

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

1 file changed

+10
-9
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Magento\Framework\App\Action\Action;
77

88
// phpcs:disable Magento2.Templates.ThisInTemplate
9+
// phpcs:disable Generic.Files.LineLength.TooLong
910

1011
/** @var \Magento\CatalogWidget\Block\Product\ProductsList $block */
1112
?>
@@ -77,6 +78,15 @@ use Magento\Framework\App\Action\Action;
7778
<?php endif; ?>
7879
<?php endif; ?>
7980
</div>
81+
<script type="text/x-magento-init">
82+
{
83+
"[data-role=tocart-form], .form.map.checkout": {
84+
"catalogAddToCart": {
85+
"product_sku": "<?= $escaper->escapeJs($_item->getSku()); ?>"
86+
}
87+
}
88+
}
89+
</script>
8090
<?php endif; ?>
8191
<?php if ($showWishlist || $showCompare) : ?>
8292
<div class="actions-secondary" data-role="add-to-links">
@@ -102,13 +112,4 @@ use Magento\Framework\App\Action\Action;
102112
<?= ($iterator == count($items) + 1) ? '</li>' : '' ?>
103113
<?php endforeach ?>
104114
</ol>
105-
<script type="text/x-magento-init">
106-
{
107-
"[data-role=tocart-form], .form.map.checkout": {
108-
"catalogAddToCart": {
109-
"product_sku": "<?= $escaper->escapeJs($_item->getSku()); ?>"
110-
}
111-
}
112-
}
113-
</script>
114115
<?php endif;?>

0 commit comments

Comments
 (0)