Here’s how to filter on a multi-select attribute using the Magento V2 API. The attribute I’m filtering on is “NEMA Rating”. It can have any number of values shown here.
The easiest way to translate the text value to the numeric value stored in the database is by using your browser’s developer tools. Hit F12.
Once you get the numeric translations. Here’s your code:
Here is the same code in a format that you can cut and paste.
filters filters = new filters()
{
filter = new associativeEntity[] {
new associativeEntity()
{
key = “nema_rating”
, value = “129”
},
new associativeEntity()
{
key = “nema_rating”
, value = “126”
},
new associativeEntity()
{
key = “nema_rating”
, value = “127”
},
new associativeEntity()
{
key = “nema_rating”
, value = “128”
},
new associativeEntity()
{
key = “nema_rating”
, value = “125”
},
new associativeEntity()
{
key = “nema_rating”
, value = “124”
}
}
};
productList = client.catalogProductList(sessionID, filters, null);
Happy coding!
[…] see Magento V2 API Filters in C# – Simple Example catalogProductEntity[] productList = client.catalogProductList(sessionID, filters, […]
LikeLike