Bigcommerce从过滤器API获得选项



我目前正在通过bigcommerce Filters V3 API制作一个电子商务网站。为此,我正在尝试制作一个过滤器。我可以scccesfully获得文档中描述的可用过滤器,但我不清楚下一步该去哪里。

作为文档状态,我得到一个包含idtypename以及可选的price_rangeproduct_count的对象数组。然而,我不明白如何获得每个过滤器的选项?

我从过滤器API得到的响应示例:

{
"data": [
{ "id": "YnJhbmQ=", "type": "brand", "name": "Brand", "product_count": 2 },
{
"id": "cmF0aW5n",
"type": "rating",
"name": "Rating",
"product_count": 1
},
{
"id": "cHJpY2U=",
"type": "price",
"name": "Price",
"price_range_min": 9.95,
"price_range_max": 225
},
{
"id": "Q29sb3I=",
"type": "product",
"name": "Color",
"product_count": 1
},
{ "id": "U2l6ZQ==", "type": "product", "name": "Size", "product_count": 1 },
{ "id": "Ym9vbA==", "type": "other", "name": "Other" }
],
"meta": {}
}

我希望每个过滤器都包含可用的选项,但事实并非如此。有人能帮我弄清楚如何获得每个过滤器的选项吗?

非常感谢您的帮助!

编辑以澄清:所以我的目标是获得过滤器的选项值。例如值redgreenblue〃;用于CCD_ 9滤波器。

因此在使用过滤器时,文档中有几个端点需要查看。

如果你试图获得这种类型的数据:

{ 
"data": [
{
"collapsed_by_default": false,
"display_name": "Category",
"display_product_count": true,
"id": "Y2F0ZWdvcnk=",
"is_enabled": true,
"items_to_show": 15,
"type": "category"
},
{
"collapsed_by_default": false,
"display_name": "Brand",
"display_product_count": true,
"id": "YnJhbmQ=",
"is_enabled": true,
"items_to_show": 10,
"sort_by": "alpha",
"type": "brand"
},
{
"collapsed_by_default": false,
"display_name": "Size",
"display_product_count": true,
"id": "U2l6ZQ==",
"is_enabled": true,
"items_to_show": 10,
"sort_by": "alpha",
"type": "product"
},
...
}
]
}

(请尝试使用此选项(https://developer.bigcommerce.com/api-reference/store-management/settings/search-filters/getenabled返回已启用的筛选器以及每个筛选器的附加配置。

(您正在使用的内容(https://developer.bigcommerce.com/api-reference/store-management/settings/search-filters/getavailable返回可用的筛选器。这意味着在任何配置之前,这是在您设置目录时完成的。

最新更新