0

How in magento i can implement OR condition when getting collection ? Currently my code looks:

->addAttributeToFilter('shipping_method', array("eq" => 'relay1'))

but ALSO i need to get orders with shipping_name relay2 so i trying next code:

->addAttributeToFilter(
    array(
        array('attribute' => 'shipping_method', 'like' => 'relay1%'),
        array('attribute' => 'shipping_method', 'eq' => 'relay2'),
    )
);

but i get this error: Cannot determine the field name.

0

i just need to use addFieldToFilter like this:

                ->addFieldToFilter(
                    array('shipping_method', 'shipping_method'),
                    array(
                        array('like'=>'mondialrelay%'),
                        array('eq'=>'beezup_beezup')
                    )
                )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.