2

I would like to show the Brand attribute under the product name on the listing page. Attached is a screenshot for reference. Reference

1
  • What is your attribute code and type of attribute ?
    – Pawan
    Commented Aug 1, 2017 at 17:12

3 Answers 3

0

You would need to override the template file to a subtheme.

Info on how to do that here: How to create a Child Theme in Magento 2

Then you can change the text, by replacing it with

<?php echo $_product->getAttributeText('attribute_code'); ?>

Don't forget to set "used in product listing" to yes in the backend

0

1) First to display your attribute as you want in listing products, check first this config admin, Catalog > Attributes > Manage Attributes. select your attribute brand then check if Used in Product Listing is set to 'yes' if no, change it to 'Yes' then save.

2) You need to reindexall

3) Go to app/design/frontend/{yourpackage}/{yourtheme}/template/catalog/product/list.phtmlunder this class class="product-name" you add this one for the attribute <h4><?php echo $_product->getBrand(); ?></h4>.

4) Clear your cache and you get what you need.

0
  1. First to display your attribute as you want in listing products, check first this config admin, Catalog > Attributes > Manage Attributes. select your attribute brand then check if Used in Product Listing is set to 'yes' if no, change it to 'Yes' then save.

  2. You need to reindexall

  3. Go to app/design/frontend/{yourpackage}/{yourtheme}/template/catalog/product/list.phtmlunder this class class="product-name" you add this one for the attribute getAttributeText('attribute_code'); ?>.

  4. Clear your cache and you get what you need.

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.