Last active
October 23, 2018 07:03
-
-
Save makfruit/7df257e256bb0eda3cfad43812d27c91 to your computer and use it in GitHub Desktop.
Sample response from Ecwid Product Filters API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"filters": { | |
"attribute_Brand": { | |
"values": [ | |
{ | |
"title":"Toyota", | |
"productCount": 10 | |
}, | |
{ | |
"title":"Ford", | |
"productCount": 12 | |
} | |
] | |
}, | |
"attribute_My Custom Attribute;": { | |
"values": [ | |
{ | |
"title":"Custom name 1", | |
"productCount": 10 | |
}, | |
{ | |
"title":"Custom name 2", | |
"productCount": 18 | |
} | |
] | |
}, | |
"option_Color": { | |
"values": [ | |
{ | |
"title":"Red", | |
"productCount": 10, | |
"image": "https://cdn.ecwid.com/red.png", // в будущем добавим картинки для цветов | |
"hexcode": "#eee111" // или не картинки, а код | |
}, | |
{ | |
"title":"Light red", | |
"productCount": 18 | |
} | |
] | |
}, | |
"option_Foot Size": { | |
"values": [ | |
{ | |
"title":"Small", | |
"productCount": 10 | |
}, | |
{ | |
"title":"Large", | |
"productCount": 18 | |
} | |
] | |
}, | |
"categories": { | |
"values": [ | |
{ | |
"id": 20, | |
"title": "Men clothes", | |
"productCount": 145 | |
}, | |
{ | |
"id": 21, | |
"title": "Women clothes", | |
"productCount": 120 | |
} | |
] | |
}, | |
"price": { | |
"minValue": 1.5, | |
"maxValue": 1500.85, | |
"values": [] // тут пусто или вообще не возвращаем | |
}, | |
"inventory": { | |
"values": [ | |
{ | |
"id": "instock", // Чтобы можно было найти именно это значение и показать только его (мы так будем делать). Title может меняться. | |
"title": "In stock", | |
"productCount": 145 | |
}, | |
{ | |
"id": "outofstock", | |
"title": "Out of stock", | |
"productCount": 12 | |
}, | |
{ | |
"id": "preorder", // Этого пока нет в выдаче. В будущем у нас может появиться preorder. | |
"title": "Preorder", | |
"productCount": 4 | |
}, | |
{ | |
"id": "lowstock", // В будущем у нас может появиться low stock (Последний шанс купить!) | |
"title": "Low stock", | |
"productCount": 1 | |
} | |
] | |
}, | |
"onsale": { | |
"values": [ | |
{ | |
"id": "onsale", | |
"title": "On sale", | |
"productCount": 15 | |
}, | |
{ | |
"id": "notonsale", | |
"title": "Regular price", | |
"productCount": 150 | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment