1

I recently installed a new template: MT Bejewelry, and this error comes out in the product page. These are the lines on the php file.

   /**
 * Get attribute text by its code
 *
 * @param $attributeCode Code of the attribute
 * @return string
 */
public function getAttributeText($attributeCode)
{
    return $this->getResource()
        ->getAttribute($attributeCode)
            ->getSource()
                ->getOptionText($this->getData($attributeCode));

Because of this error I can't see the Product Description.

How can I solve this?

Thank You.

1

Look in your theme for a line like this:

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

This only works if the attribute with the code specified above is of type select or multiselect.
If you say the problem is with the description then maybe you have something like

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

If you do, this is wrong. you should replace it with

$description = $product->getDescription();
echo $this->helper('catalog/output')->productAttribute($_product, $_description, 'description');
  • I don't know where to look exactly. I've found something similar with what you said to me but with 'mater' or 'gemstone' instead of 'description'. – gioiello Jun 23 '15 at 9:41
  • then make sure that mater or gemstone are dropdown or multiselect attributes and their source model exists. – Marius Jun 23 '15 at 10:49

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.