4

How can I move Category Description to the bottom after product list in Magento 2.0.4?

I have followed every single advice on this URL:
how to get Category description after product listing
how to get Category description to the bottom of the page magento 1.9

But, They don't work because the advice is for Magento 1.9 and not for Magento 2.0.4.

I have tried to modify list.phtml but it seems there is another file that is controlling the category image and description feed. Please help.

2 Answers 2

16

In your theme folder, add a catalog_category_view.xml layout under Magento_Catalog/layout (the complete path should be app/design/frontend/[Company]/[theme_name]/Magento_Catalog/layout/catalog_category_view.xml).

Now you can simply move the description to the bottom with the following:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="category.description" destination="content.bottom" />
    </body>
</page>
2

At category page, magento call a registry current_category whuch contain the current category object .

If you call this registry variable at list.phtml then you can easily get category description


$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category=$objectManager->get('Magento\Framework\Registry')->registry('current_category');
if($category){
    echo $category->getDescription();
}

Your Answer

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

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