|
https://img01.yzcdn.cn/upload_files/2022/04/18/FkuohUx6U5ZFTjS7bp9Rqxq0Wo1W.jpeg
要做到图中的规格需要入参的格式如下:
``{
"param": {
"item_type": 0,
"image_ids": [
4324925660
],
"title": "我是商品的标题呢11",
"item_price_param": {
"price": 100
},
"stock_deduct_mode": 1,
"quantity": 10,
"item_delivery_param": {
"postage": 10,
"delivery_setting": {
"express": true
}
},
"post_sale_param": {
"refund_param": {
"support_refund": false
}
},
"hide_stock": 1,
"desc": "<p><img data-origin-width=\"658\" data-origin-height=\"344\" src=\"https://i.ibb.co/zJMpX2D/Wechat-IMG265.png\" /></p>",
"sku_list": [
{
"sku_props": [
{
"prop_value_name": "涤纶",
"prop_name": "材质",
"prop_name_id": 11,
"prop_value_id": 1
},
{
"prop_value_name": "140g",
"prop_name": "重量",
"prop_name_id": 21,
"prop_value_id": 2
}
],
"price": 100,
"stock_num": 1
},
{
"sku_props": [
{
"prop_value_name": "涤纶",
"prop_name": "材质",
"prop_name_id": 1,
"prop_value_id": 11
},
{
"prop_value_name": "300g",
"prop_name": "重量",
"prop_name_id": 2,
"prop_value_id": 22
}
],
"price": 100,
"stock_num": 1
},
{
"sku_props": [
{
"prop_value_name": "纯棉",
"prop_name": "材质",
"prop_name_id":1,
"prop_value_id":12
},
{
"prop_value_name": "300g",
"prop_name": "重量",
"prop_name_id": 2,
"prop_value_id":22
}
],
"price": 100,
"stock_num": 1
},
{
"sku_props": [
{
"prop_value_name": "纯棉",
"prop_name": "材质",
"prop_name_id": 1,
"prop_value_id":12
},
{
"prop_value_name": "140g",
"prop_name": "重量",
"prop_name_id": 2,
"prop_value_id":21
}
],
"price": 100,
"stock_num": 1
}
]
}
}
``
讲解:
如果这个商品有两个相关规格,分别为材质和重量,且材质有2个规格值,分别为涤纶和纯棉;重量有2个规格值,分别为140g和300g。
那么这两个规格名称可以组合成4组规格。材质的2个规格值*重量的2个规格值 = 4个。(笛卡尔积)
分别为 涤纶、140g;涤纶、300个;纯棉、140g;纯棉、300g
具体如何入参,可以看入参示例和店铺后台的图片。
prop_name_id的值 与prop_name的值 一对一
prop_value_id的值 与 prop_value_name的值 一对一。
|
|