1

I made a attribute set and custom text field attribute. Now I need the value of the attribute shown in list.phtml (catalog).

I tried without success:

Fail 1

<?php  echo $product->getAttributeText('catalog_description'); ?>

Fail 2

<?php echo $product->getAttributeText('catalog_description'); ?>

Fail 3

<?php $product->getAttributeText('catalog_description'); ?>

Fail 4

<?php echo $catalog_description; ?>
1
  • I'm afraid I'm having the exact same problem. What I'm surprised by is that some attributes are available using the getdata() method, for example price, sku and weight, although these are also attributes.
    – tecjam
    Commented Apr 11, 2016 at 16:08

1 Answer 1

0

I found the solution, this works:

<?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_product->getcatalog_description(), 'catalog_description'); ?>

In the Attribute setting in Magento 2 choose in Storefront properties YES for:

  • Visible on Catalog Pages on Storefront
  • Used in Product Listing

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.