Magento Collection with nested "OR" "AND" Filter -


i try filter collection have nest "or" "and" filter t_id & t_code both attributes

     $collection->addattributetofilter(                         array(                             array(                                 'attribute' => 't_id',                                 'null' => true                             ),                                  array(                                     'attribute' => 't_id',                                     'finset' => $allowedtid                                 )                          )                     ); $collection->addattributetofilter(                     array(                         array(                             'attribute' => 't_code',                             'null' => true                         ),                         array(                             'attribute' => 't_code',                             'finset' => $tattcode                         )                     )                 ); 

here sql of query

where ((at_t_id.value null) or (find_in_set('', at_t_id.value))) , ((at_t_code.value null) or (find_in_set('2348', at_t_code.value))) 

but trying this

 (at_t_id.value null)     or    (      (find_in_set('1245', at_t_id.value))         ,      (         (at_t_code.value null)           or         (find_in_set('2348', at_t_code.value))      )  ) 

is there way can achieved?


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -