deivisonarthur
1/7/2013 - 6:55 PM

filtro2.php

$results = Mage::getModel('xyz/abc')->getCollection();
$results->addFieldToSelect('name');
$results->addFieldToSelect('keywords');
$results->addOrder('name','ASC');
$results->setPageSize(5);

$results->getSelect()->where("keywords like '%foo%' or additional_keywords  like '%bar%'");

$results->load();

echo json_encode($results->toArray());



link: http://stackoverflow.com/questions/3826474/magento-addfieldtofilter-two-fields-match-as-or-not-and