3

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

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

4

1 回答 1

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"
      }
    }
  ]
}
于 2013-01-10T16:37:33.107 回答