Skip to content

Commit 1652d16

Browse files
committed
ACP2E-703: Page refreshes when products are added to cart
1 parent d08059a commit 1652d16

File tree

1 file changed

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

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ use Magento\Framework\App\Action\Action;
99

1010
/** @var \Magento\CatalogWidget\Block\Product\ProductsList $block */
1111
?>
12+
<?php
13+
/**
14+
* Product carousel widget template
15+
*
16+
* @var \Magento\Framework\Escaper $escaper
17+
*/
18+
?>
1219
<?php if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) : ?>
1320
<?php
1421
$type = 'widget-product-carousel';
@@ -93,6 +100,15 @@ use Magento\Framework\App\Action\Action;
93100
</div>
94101
</div>
95102
<?= ($iterator == count($items) + 1) ? '</li>' : '' ?>
103+
<script type="text/x-magento-init">
104+
{
105+
"[data-role=tocart-form], .form.map.checkout": {
106+
"catalogAddToCart": {
107+
"product_sku": "<?= $escaper->escapeJs($_item->getSku()); ?>"
108+
}
109+
}
110+
}
111+
</script>
96112
<?php endforeach ?>
97113
</ol>
98114
<?php endif;?>

0 commit comments

Comments
 (0)