SwissUpLabs Logo

Display activity block on category page

You can add the code mentioned below to the product list template, that is shown on category page.

Usually you can find it at app/code/Magento/Catalog/view/frontend/templates/product/list.phtml

Example 1

Activity block on category page

<?php
    echo $this->helper('Swissup\Attributepages\Helper\Product')
        ->setCollection($_productCollection)
        ->setProduct($_product)
        ->setAttributeCode(['activity'])
        ->setCssClass('hidden-label a-center')
        ->setParentPageLinkTitle(['activity' => false])
        ->setUseImage(true)
        ->setImageType('thumbnail')
        ->setUseLink(['activity'  => true])
        ->setSize(50, 25)
        ->setKeepFrame(false)
        ->toHtml();
?>

Look at list of available attributepages/product helper methods

Example 2

Activity block on category page

<?php
echo $this->helper('Swissup\Attributepages\Helper\Product')
    ->setCollection($_productCollection)
    ->setProduct($_product)
    ->setAttributeCode(['activity'])
    ->setImageType('thumbnail')
    ->setCssClass('hidden-label')
    ->setSize(38, 17)
    ->setKeepFrame(false)
    ->toHtml();
?>

Look at list of available attributepages/product helper methods

Edit this Page