1) Equals: eq
$_products->addAttributeToFilter('status', array('eq' => 1));
2) Not Equals - neq
$_products->addAttributeToFilter('sku', array('neq' => 'test-product'));
3) Like - like
$_products->addAttributeToFilter('sku', array('like' => 'UX%'));
4) Not Like - nlike
$_products->addAttributeToFilter('sku', array('nlike' => 'err-prod%'));
5) In - in
$_products->addAttributeToFilter('id', array('in' => array(1,4,98)));
6) Not In - nin
$_products->addAttributeToFilter('id', array('nin' => array(1,4,98)));
7) NULL - null
$_products->addAttributeToFilter('description', 'null');
8) Not NULL - notnull
$_products->addAttributeToFilter('description', 'notnull');
9) Greater Than - gt
$_products->addAttributeToFilter('id', array('gt' => 5));
10) Less Than - lt
$_products->addAttributeToFilter('id', array('lt' => 5));
11) Greater Than or Equals To- gteq
$_products->addAttributeToFilter('id', array('gteq' => 5));
12) Less Than or Equals To - lteq
$_products->addAttributeToFilter('id', array('lteq' => 5));
$_products->addAttributeToFilter('status', array('eq' => 1));
2) Not Equals - neq
$_products->addAttributeToFilter('sku', array('neq' => 'test-product'));
3) Like - like
$_products->addAttributeToFilter('sku', array('like' => 'UX%'));
4) Not Like - nlike
$_products->addAttributeToFilter('sku', array('nlike' => 'err-prod%'));
5) In - in
$_products->addAttributeToFilter('id', array('in' => array(1,4,98)));
6) Not In - nin
$_products->addAttributeToFilter('id', array('nin' => array(1,4,98)));
7) NULL - null
$_products->addAttributeToFilter('description', 'null');
8) Not NULL - notnull
$_products->addAttributeToFilter('description', 'notnull');
9) Greater Than - gt
$_products->addAttributeToFilter('id', array('gt' => 5));
10) Less Than - lt
$_products->addAttributeToFilter('id', array('lt' => 5));
11) Greater Than or Equals To- gteq
$_products->addAttributeToFilter('id', array('gteq' => 5));
12) Less Than or Equals To - lteq
$_products->addAttributeToFilter('id', array('lteq' => 5));
No comments:
Post a Comment