0

Can anyone help me, how to add a custom section for category products section using custom module in magento2.

Please find the screenshot below.

enter image description here

Thanks

1 Answer 1

2

Please try with the below code which will help you how to add custom section to the category landing page from your custom module.

app/code/Magently/Ajax/view/frontend/layout/catalog_category_view.xml

<?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="category.product.addto">
                <block class="Magento\Framework\View\Element\Template" name="magently.ajax.info2" template="Magently_Ajax::test.phtml" />
        </referenceContainer>        
    </body>
</page>

app/code/Magently/Ajax/view/frontend/templates/test.phtml

<?php echo "Custom Template" ?>

Please note:- may be the above code will not give exact result...change the reference container name and try it from your end.

class="Magento\Framework\View\Element\Template" based on your requirement you can change the block class.

4
  • Hi @nagaraju Can you please tell me what is the exact container name i wants to use in place "category.product.addto" Dec 3, 2018 at 9:58
  • let me know whether the above code is working? Dec 3, 2018 at 13:30
  • Hi @nagaraju any update on this Dec 4, 2018 at 8:03
  • No @shivashankarm Dec 4, 2018 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.