Add filters using addAttributeToFilter Conditionals – Magento

Have you ever wanted to add a condition (where) in a Magento query?

Usually you’ll see queries like this:

You can add conditions like this:

Here’s the list of conditional tags you can use in your queries:

Equals

Not Equals

Like

Not Like

In

Not In

null

Not NULL

Greater Than

Less Than

Greater Than or Equals To

Less Than or Equals To – lteq

Check out the Magento Wiki page about Using Collections and modifiers.

No comments yet, leave yours!

Leave a Reply

Add <code> Some Code </code> by using this tags.