Magento Filter Custom EAV by Attribute Error -


i unable filter custom eav collection, otherwise performs normally:

$mymodel = mage::getmodel('mymodel/things'); $collection = $mymodel->getcollection()     ->addattributetoselect('*'); 

various attempts made filter collection, e.g.:

$collection->addfieldtofilter('my_attribute','1');  $collection->addattributetofilter('my_attribute', array('like' => '1')); 

anything try throws error:

invalid method mage_eav_model_entity_attribute::isscopeglobal(array ( ) )  #0 c:\wamp\www\magento\app\code\core\mage\catalog\model\resource\collection\abstract.php(186): varien_object->__call('isscopeglobal', array) #1 c:\wamp\www\magento\app\code\core\mage\catalog\model\resource\collection\abstract.php(186): mage_eav_model_entity_attribute->isscopeglobal() 

thank in advance suggestions , direction.

update:

hacking following , ->addattributetofilter works should. still need proper solution custom model. thank you.

mage_catalog_model_resource_collection_abstract:  **hacked** line186  if ($store_id != $this->getdefaultstoreid() ){ //&& !$attribute->isscopeglobal()) { 

the principle issue extending wrong class in custom model resource collection class:

was:  ... extends mage_catalog_model_resource_collection_abstract now:  ... extends mage_eav_model_entity_collection_abstract 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -