Basically I installed one market place module in my website……that have a validation attribute…but which is not …Product Listing,Product Listing,Layered Navigation…so when I use Flat Product …its attributes and its value is not going in flat product tables…so due to not availability of attribute I can not validate my setting….
My attributes setting values..
----------------------------
class VES_VendorsProduct_Model_Source_Approval extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
{
const STATUS_NOT_SUBMITED = 0;
const STATUS_PENDING = 1;
const STATUS_APPROVED = 2;
const STATUS_UNAPPROVED = 3;
static public function getOptionArray()
{
return array(
self::STATUS_NOT_SUBMITED => Mage::helper('vendors')->__('Not Submited'),
self::STATUS_PENDING => Mage::helper('vendors')->__('Pending'),
self::STATUS_APPROVED => Mage::helper('vendors')->__('Approved'),
self::STATUS_UNAPPROVED => Mage::helper('vendors')->__('Not Approved')
);
}
public function getAllOptions()
{
return array(
array(
'label' => Mage::helper('vendors')->__('Not Submited'),
'value' => self::STATUS_NOT_SUBMITED
),
array(
'label' => Mage::helper('vendors')->__('Pending'),
'value' => self::STATUS_PENDING
),
array(
'label' => Mage::helper('vendors')->__('Approved'),
'value' => self::STATUS_APPROVED
),
array(
'label' => Mage::helper('vendors')->__('Not Approved'),
'value' => self::STATUS_UNAPPROVED
),
);
}
}
My validation In List.php block
---------------------------------
$collection->addAttributeToFilter('approval',VES_VendorsProduct_Model_Source_Approval::STATUS_APPROVED);
so problem is this …the value of this is not avail in flat table….its working fine with eav…but not fine with flat tables…..so how can i solve this issue…how can i get attribute value by product id…with query..or any solution
Best Answer
Only the attributes that are marked to be used in product listing are copyed to the flat tables. Mark it like this and reindex everything.