在Shopify中获取产品的集合名称

时间:2013-01-09 08:06:13

标签: shopify

在Shopify中,如何获取特定产品所属的自定义集合的名称?

例如,要获取 SKU ,我可以使用{{ line_item.sku }}或获取 价格 我可以使用{{ line_item.line_price}}

1 个答案:

答案 0 :(得分:2)

API docs,列出某个product_id的所有自定义集合:

GET /admin/custom_collections.json?product_id=632910392

响应:

HTTP/1.1 200 OK

{
  "custom_collections": [
    {
      "body_html": "<p>The best selling ipod ever</p>",
      "handle": "ipods",
      "id": 841564295,
      "published_at": "2008-02-01T19:00:00-05:00",
      "sort_order": "manual",
      "template_suffix": null,
      "title": "IPods",
      "updated_at": "2008-02-01T19:00:00-05:00",
      "image": {
        "created_at": "2012-12-11T12:01:29-05:00",
        "src": "http://cdn.shopify.com/s/files/1/0006/9093/3842/collections/ipod_nano_8gb.jpg?0"
      }
    }
  ]
}
相关问题