Home » Magento23 December 2010

Magento: How to get / filter all products by attribute value?

Here, I will show you how you can filter or fetch products related to any particular attribute and value.

A simple scenario will be filtering products by manufacturer/brand. Suppose, I want to get all products under ‘Samsung’ manufacturer/brand.

For this, you need the attribute code and attribute value ID for which you are fetching products.

To fetch attribute name and value, you can see my previous post here:- Magento: How to get attribute name and value?

Now, lets move on to the code. Here is how you can do this:-

Hope this helps. Thanks.

Magento

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed