Skip to main content
added 194 characters in body
Source Link
Rahul Singh
  • 1.7k
  • 2
  • 20
  • 40

Can you try by this way, I think this will solve your problem

$collection->getSelect()
 ->where(" (IF('Your`Your attribute')attribute` LIKE= 'Value') AND (IF('Your`Your attribute')attribute` LIKE= 'Value'))
  OR 
((IF('Your`Your attribute')attribute` LIKE= 'Value') AND `Your attribute` = 'Value')");

In your case in the getSelect() could be:

->getSelect(IF)->where('Your"(`supplier_id` attribute'= '1' AND `product_type` = 'first_type') LIKEOR 'Value'(`supplier_id` = '2' AND `product_type` = 'another_type')");

Can you try by this way, I think this will solve your problem

$collection->getSelect()
 ->where(" (IF('Your attribute') LIKE 'Value') AND (IF('Your attribute') LIKE 'Value'))
 OR 
((IF('Your attribute') LIKE 'Value') AND (IF('Your attribute') LIKE 'Value')");

Can you try by this way, I think this will solve your problem

->getSelect()->where(" (`Your attribute` = 'Value' AND `Your attribute` = 'Value') OR (`Your attribute` = 'Value' AND `Your attribute` = 'Value')");

In your case in the getSelect() could be:

->getSelect()->where("(`supplier_id` = '1' AND `product_type` = 'first_type') OR (`supplier_id` = '2' AND `product_type` = 'another_type')");
Post Undeleted by Rahul Singh
deleted 174 characters in body
Source Link
Rahul Singh
  • 1.7k
  • 2
  • 20
  • 40

Can you try by this way, I think this will solve your problem

$collection->addFieldToFilter(array>getSelect()
          array->where('attribute' => 'supplier_id', 'like'" =>(IF('Your '1'attribute'),
       LIKE 'Value') AND array('attribute' => 'product_type',IF('Your 'like'attribute') =>LIKE 'first_type')
'Value'));
$collection->addFieldToFilterOR 
(array(
          arrayIF('attribute' => 'supplier_id', 'like' =>'Your '2'attribute'),
       LIKE 'Value') AND array('attribute' => 'product_type',IF('Your 'like'attribute') =>LIKE 'another_type')
'Value')");

Can you try by this way, I think this will solve your problem

$collection->addFieldToFilter(array(
          array('attribute' => 'supplier_id', 'like' => '1'),
          array('attribute' => 'product_type', 'like' => 'first_type')
));
$collection->addFieldToFilter(array(
          array('attribute' => 'supplier_id', 'like' => '2'),
          array('attribute' => 'product_type', 'like' => 'another_type')
));

Can you try by this way, I think this will solve your problem

$collection->getSelect()
->where(" (IF('Your attribute') LIKE 'Value') AND (IF('Your attribute') LIKE 'Value'))
OR 
((IF('Your attribute') LIKE 'Value') AND (IF('Your attribute') LIKE 'Value')");
Post Deleted by Rahul Singh
Source Link
Rahul Singh
  • 1.7k
  • 2
  • 20
  • 40

Can you try by this way, I think this will solve your problem

$collection->addFieldToFilter(array(
          array('attribute' => 'supplier_id', 'like' => '1'),
          array('attribute' => 'product_type', 'like' => 'first_type')
));
$collection->addFieldToFilter(array(
          array('attribute' => 'supplier_id', 'like' => '2'),
          array('attribute' => 'product_type', 'like' => 'another_type')
));