Skip to content

Commit

Permalink
Add section detection for pages
Browse files Browse the repository at this point in the history
  • Loading branch information
azemoh committed Sep 23, 2020
1 parent e94f34b commit bf342b8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="fera.ai.footer">
<block class="Fera\Ai\Block\Footer"
name="fera_ai.footer.product.list"
template="Fera_Ai::footer/product/list.phtml" />
</referenceContainer>
</body>
</page>
1 change: 1 addition & 0 deletions src/app/code/Fera/Ai/view/frontend/templates/footer.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

window.fera.push('setCart', <?= $block->getCartJson(); ?>);
</script>
<?= $this->getChildHtml('fera_ai.footer.product.list'); ?>
<?= $this->getChildHtml('fera_ai.footer.product.view'); ?>
<?= $this->getChildHtml('fera_ai.footer.checkout.success'); ?>
<script async type="application/javascript" src="<?= $block->getJsUrl(); ?>"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<script>
window.fera = window.fera || [];
window.fera.push('setSection', 'product_list');
</script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script>
window.fera = window.fera || [];
window.fera.push('setProduct', <?= $block->getProductJson(); ?>);
window.fera.push('setSection', 'product_view');
</script>

0 comments on commit bf342b8

Please sign in to comment.