私は次のようにMagentoから属性オプションを取得しています:
<?php
if ($attribute->usesSource()) {
$options = $attribute->getSource()->getAllOptions(false);
}
?>
組み込みの「color」属性のオプションを取得しようとするまでは正常に機能していました。次のエラーが発生しました。
PHP Fatal error: Call to a member function setAttribute() on a non-object in app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php on line 374
getSource()呼び出しが失敗し、このエラーが発生したように見えます。なぜこれが起こるのか、そしてどうすればカラーオプションを出すことができるのか誰かが知っていますか?
ありがとう!