i am working on a magento project and i need to get the value according to country wise like select address where country ="Nepal"
can we send the where condition in getCollection()
function
$collection = Mage::getModel('relocator/location')->getCollection();
any help will be appreciated
got the solution ;P
Mage::getModel('relocator/location')
->getCollection()
->addFilter('country','Nepal');
You can use diffrent condition like below reference from this.
$collection = Mage::getModel('catalog/product')->getCollection();
Is Equal To
$collection->addAttributeToFilter('status', array('eq' => 1));
Greater Than
$collection->addAttributeToFilter('price', array('gt' => 3));
Contains – with % wildcards Is NULL
$collection->addAttributeToFilter('sku', array('like' => 'DVD%'));
$collection->addAttributeToFilter('entity_id', array('nin' => array(1,2,12)));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With