I want to display custom attribute value under the product name on category page.

Attribute type is dropdown and attribute name is Brand.

I want to display the brand name under the product name on category page in GRID and LIST mode.

How can i do that? What's the standard way to display brand name under product name?

Do i need to create any module for that or custom function?

Any help would be appreciated.

3 Answers 3


Edit below file


$attribute = $_product->getResource()->getAttribute('attribute_code');

// Get Value

$attributeValue = $attribute->getFrontend()->getValue($_product);

// Get Label

$attributeLabel = $attribute->getStoreLabel();

Note: Make sure “Visible on Product View Page on Front-end” and “Used in Product Listing” options under storefront Properties are set to Yes.

  • Thank you for your answer. How do you display the attribute (control the output product name) on the product details page though? I would like to display Capacity just under the product name "title". Thanks. Commented May 3, 2019 at 6:32
<?php/***********Display Brand Attribute************/?>
$om = \Magento\Framework\App\ObjectManager::getInstance();
$attribute = $om->get(\Magento\Catalog\Api\ProductAttributeRepositoryInterface::class)->get('manufacturer');
    foreach ($attribute->getOptions() as $option) {
        $name = $option->getLabel();
        $optId = $option->getValue();
        $curnt_cat_url = $category->getUrl();
        $brandId = '?manufacturer='.$optId;

        $swatchCollection = $om->create('Magento\Swatches\Model\ResourceModel\Swatch\Collection');

        $ThumbImage =  $swatchHelper->getSwatchAttributeImage('swatch_thumb', $item->getValue());
        //$SwatchImage = $swatchHelper->getSwatchAttributeImage('swatch_image', $item->getValue());
        <?php if ($optId) { ?>
            <div class="brand_bg">
                <li class="brand_img_bg"> 
                    <a href="<?php echo $curnt_cat_url.$brandId ?>"><img src="<?php echo $ThumbImage; ?>"></a>
                <!--<a href="<?php //echo $curnt_cat_url.$brandId ?>"><?php //echo $name; ?></a>-->
        <?php } ?>
    <?php } ?>
<?php } ?> 

If you follow Abhishek Panchal answer above even-then your custom attribute value noe displaying on category pages the confirm you had not enabled this attribute for catalog pages: edit the attribute select:

storefront properties -> Used in Product Listing -> yes

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.