Custom Attribute and value not Appearing in Flat Product table if Attribute is not in…Product Listing,Product Listing,Layered Navigation

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

setting of attribute..
———————-enter image description here

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

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.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply