I have created an product attribute
. initially its property "Used in Product Listing" was "No". So when i try to fetch its value in listing page it was returning an empty value. Therefore i changed its value to "Yes" then reIndexed all the Index from admin panel. But still no value is returning in the listing page. However i'm able to get its value in Product details page.
Am i missing something. ?
Please help.!
EDIT Adding code :
private function findPointsPercentage(){
$attribute = $this->role."_fbp";
/*
* Get master Product using the productcode
*/
$product = $this->product;
$isMasterProduct = (int)$product->getIsMasterRecord();
if(!$isMasterProduct){
$masterPdtCollection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToFilter('is_master_record',1)
->addAttributeToFilter('productcode',$product->getProductcode());
if($masterPdtCollection instanceof Varien_Data_Collection && $masterPdtCollection->getSize()){
$product = $masterPdtCollection->getFirstItem();
}
}
$percentage = $product->getData($attribute);
}
The variable $this->role will be based on user. In my case role is general. So value of $attribute will be 'general_fbp'.
I'm using the same function in the details page where i'm able to pull the value for general_fbp
More Details :
This function is defined in a model. And the value of the is $this->product is value from the forloop in list.phtml i.e
<?php $_i = 0; foreach ($_productCollection as $_product): ?>