0

Trying to show an attributetext of an attribute at each product on category pages. Got the following code:

<?php
    $attributeSetModel = Mage::getModel("eav/entity_attribute_set");
    $attributeSetModel->load($_product->getAttributeSetId());
    $attributeset = strtolower($attributeSetName = $attributeSetModel->getAttributeSetName());
    if($attributeset == 'seeds'):
    echo '<div class="qty-seeds">' . $_product->getResource()->getAttribute('qty_seeds')->getStoreLabel() . ': ';
    echo $_product->getAttributeText('qty_seeds');
    echo '</div>';
    endif;
?>

The label does show but not the text... any one know why and how to fix it?

1

Solution was enabling 'Show in Product Listing' for the relating attribute

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.