Frage

How to show the product attribute in the Product listing page i had used the helper in Magento_Catalog (Magento_Catalog/templates/product/list.phtml) but it gives the value of the product attribute not label the attribute type is Dropdown.

$this->helper('Magento\Catalog\Helper\Output');
$_helper->productAttribute($_product, $_product->getManufacturer(), 'manufacturer');

I got the out as 5755

I want to get the value using above method how can we do this.

Thanks in Advance:)

War es hilfreich?

Lösung

Method 1:

echo $_product->getAttributeText('manufacturer'); 

Method 2:

$manufacturer = $_product->getResource()->getAttribute('manufacturer');
echo $manufacturer->getFrontend()->getLabel($_product);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange
scroll top