Product list
Setting type product_picker dùng để xuất ra trường bộ chọn sản phẩm được lấy từ các sản phẩm có sẵn của cửa hàng. Bạn có thể sử dụng các trường này để thu thập nhiều sản phẩm, chẳng hạn như một nhóm sản phẩm để giới thiệu trên trang chủ.
Setting
{
id: "product_list",
type: "product_list",
label: "product_list",
default: [],
},
Display
Khi truy cập giá trị product_list , dữ liệu được trả về dưới dạng :
{settings.product_list}
Output
Entity
export interface Product {
id: UniqueId;
title: string;
handle: string;
featuredImage: null | {
url: string;
};
}
[
{
"id": "gid://shopify/Product/8255435636959",
"title": "The Archived Snowboard",
"handle": "the-archived-snowboard",
"featuredImage": {
"url": "https://cdn.shopify.com/s/files/1/0682/1055/7151/products/Main_52f8e304-92d9-4a36-82af-50df8fe31c69.jpg?v=1704390896"
}
},
{
"id": "gid://shopify/Product/8255435604191",
"title": "The Videographer Snowboard",
"handle": "the-videographer-snowboard",
"featuredImage": {
"url": "https://cdn.shopify.com/s/files/1/0682/1055/7151/files/Main.jpg?v=1704390897"
}
},
{
"id": "gid://shopify/Product/8255435571423",
"title": "The Minimal Snowboard",
"handle": "the-minimal-snowboard",
"featuredImage": null
}
]