سؤال

I created a custom attribute in my products page. The attribute is a dropdown list.

The name of the attribute is soldby.

I want to extract the value of that attribute.

I wrote:

$seller= Mage::getModel('catalog/product')->load($item->getProductId()) ->getData('soldby');

This returns me null.

If I do something similar to an attribute which is a textfield, it works fine.

How can I extract the option selected ?

Please help.

هل كانت مفيدة؟

المحلول

$product = Mage::getModel('catalog/product')->load($item->getProductId());  

$product->getAttributeText('soldby');

نصائح أخرى

Please try this:

$seller= Mage::getModel('catalog/product')->load($item->getProductId());
$seller->getAttributeText('soldby');
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top