Feed模板数据字典
一、数据字典
1.字典结构JSON
{
productList:[
product:{
productId:"产品ID",
title;"产品标题",
...
variants:[
variant:{
feedId:"变体GID",
...
}
],
firstVariant:{
feedId:"",
...
}
images:[
image:{
src:"图片路径",
alt:"ALT文字",
width:"宽度",
height:"高度"
}
],
featuredImage;{
src:"图片路径",
alt:"ALT文字",
width:"宽度",
height:"高度"
}
...
}
],
storeConfig:{
id:"店铺ID",
number:"店铺序号",
symbol:"唯一标识",
currency:"货币类型",
currencyRate:"货币小数位",
locales:"语言环境"
},
domain:{
host:"域名"
}
}
productList :产品数组
productId
string
产品ID
title
string
产品标题(优先取feed组中的产品自定义标题,如果为空取产品seo标题)
description
string
产品描述(优先取eed组中的产品自定义描述,如果为空取产品seo描述)
imageVOList
array
图片对象数组
featuredImage
object
产品首图对象
imageLink
string
优先获取feed组中自定义的图片路径,如果未设置取产品首图图片路径
additionalImageLink
string
产品图片路径(除首图外最多10张图,多个路径用逗号分隔)
images
array
产品图片路径数组(除首图外最多10张图)
quantity
int
库存(优先取feed组中自定义库存值,如果为空计算产品下所以变体总库存数量求和)
availability
string
优先取feed组中自定义availability,如果未定义则根据库存数来填充,库存数>0: in_stock;反之out_of_stock
condition
string
优先取feed组中自定义condition,未定义默认new
variants
array
变体对象数组
firstVariant
object
首个变体对象
compareAtPrice
string
LP产品首个变体市场价
compareAtPriceMax
string
LP产品变体最高市场价
compareAtPriceMin
string
LP产品变体最低市场价
price
string
产品销售价,优先取feed组中的自定义的价格,如未定义取产品下首个变体的销售价
priceMax
string
LP产品变体最高销售价
priceMin
string
LP产品变体最低销售价
gtin
string
gtin需在feed组中自定义,如未定义取LP产品下首个变体的brcode
brand
string
brand需在feed组中自定义,如未定义取LP产品vendor
mpn
string
mpn需在feed组中自定义
googleProductCategory
string
googleProductCategory需在feed组中自定义
googleProductType
string
googleProductType需在feed组中自定义
gender
string
gender需在feed组中自定义
ageGroup
string
ageGroup需在feed组中自定义
color
string
color需在feed组中自定义
link
string
产品link(已废弃,但仍然兼容,用handle代替)
feedId
string
GID优先取feed组中的自定义的GID,未定义取LP产品ID
itemGroupId
string
itemGroupId需在feed组中自定义
size
string
size需在feed组中自定义
shippingWeight
string
shippingWeight需在feed组中自定义
adWordsGrouping
string
adWordsGrouping需在feed组中自定义
adWordsLabels
string
adWordsLabels需在feed组中自定义
customProduct
string
customProduct需在feed组中自定义
collections
array
集合对象数组
collectionIds
string
产品所在集合IDS(多个集合ID逗号分隔)
tags
string
产品标签(多个标签逗号分隔)
productType
string
LP产品类型
vendor
string
LP产品品牌(供应商)
seoTitle
string
LP产品seo标题
seoDescription
string
LP产品seo描述
seoKeywords
string
LP产品seo关键词
productTitle
string
LP产品标题
bodyHtml
string
LP产品html描述
handle
string
LP产品句柄handle
featuredImage:图片对象
src
string
src
alt
string
ALT文字
width
Integer
宽度
height
Integer
高度
imageVOList:图片对象数组
src
string
src
alt
string
ALT文字
width
Integer
宽度
height
Integer
高度
variants:变体对象数组
title
string
feed组中自定义title
description
string
feed组中自定义description
quantity
Integer
feed组中自定义库存,如未定义取变体对应库存
condition
string
feed组中自定义condition
availability
string
feed组中自定义availability
price
string
feed组中自定义price
gtin
string
feed组中自定义gtin
brand
string
feed组中自定义brand
mpn
string
feed组中自定义mpn
googleProductCategory
string
feed组中自定义googleProductCategory
googleProductType
string
feed组中自定义googleProductType
gender
string
feed组中自定义gender
ageGroup
string
feed组中自定义ageGroup
color
string
feed组中自定义color
feedId
string
feed组中自定义GID
customLabel0
string
feed组中自定义customLabel0
customLabel1
string
feed组中自定义customLabel1
customLabel2
string
feed组中自定义customLabel2
customLabel3
string
feed组中自定义customLabel3
customLabel4
string
feed组中自定义customLabel4
itemGroupId
string
feed组中自定义itemGroupId
size
string
feed组中自定义size
shippingWeight
string
feed组中自定义shippingWeight
adWordsGrouping
string
feed组中自定义adWordsGrouping
adWordsLabels
string
feed组中自定义adWordsLabels
customProduct
string
feed组中自定义customProduct
featuredImage
object
变体图片对象
variantId
string
LP变体ID
sku
string
sku
barcode
string
barcode条码
levyTariff
Boolean
是否征收关税
tariffCode
string
HS关税代码
originalPrice
string
市场价
sellingPrice
string
销售价
weight
string
重量
weightUnit
string
重量单位
allowTrackInventory
boolean
允许跟踪库存
outOfStockBehavior
string
缺货时行为:sell继续销售,off下架
position
string
position
option1Name
string
option1Name
option1Value
string
option1Value
option2Name
string
option2Name
option2Value
string
option2Value
option3Name
string
option3Name
option3Value
string
option3Value
option4Name
string
option4Name
option4Value
string
option4Value
option5Name
string
option5Name
option5Value
string
option5Value
requiresShipping
Boolean
是否需要运输
saleNum
string
销量
collections:集合对象数组
title
string
集合名称
handle
string
handle
id
string
集合id
position
Integer
排序位置
type
string
集合类型(manual
storeConfig:店铺配置
id
string
店铺ID
number
int
店铺序号
symbol
string
唯一标识
currency
string
货币类型
currencyRate
int
货币小数位
locales
string
语言环境
domain:域名等信息
host
string
域名
二、模板例子:
1.取值语法
1.1 product维度取值freemarker模板引擎语法
<#if productList?? && (productList?size > 0) >
<#list productList as product>
<item>
<productId>${product.productId!''}</productId>
</item>
</#list>
</#if>
1.2 变体维度取值freemarker模板引擎语法
<#if productList?? && (productList?size > 0) >
<#list productList as product>
<#if product.variants?? && (product.variants?size > 0) >
<#list product.variants as variant>
<item>
<variantId>${variant.variantId!''} </variantId>
</item>
</#list>
</#if>
</#list>
</#if>
2.LAZYSHOP soufeel US站模板示例
US默认产品-freemark
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title> </title>
<description> </description>
<link> </link>
<#if productList?? && (productList?size > 0) >
<#list productList as product>
<item>
<g:id>${product.feedId!''}</g:id>
<g:title> ${product.title?replace("&","&")}</g:title>
<g:description>${(product.description?replace("&","&"))!''}</g:description>
<g:mpn>${product.mpn!''}</g:mpn>
<g:link>https://soufeel.com/products/${product.link!''}</g:link>
<g:mobile_link>https://soufeel.com/products/${product.link!''}</g:mobile_link>
<g:image_link>${product.imageLink!''}</g:image_link>
<g:condition>new</g:condition>
<g:availability>in stock</g:availability>
<g:price>${product.price!''} ${storeConfig.currency!''}</g:price>
<g:brand>Soufeel</g:brand>
<g:google_product_category>${product.googleProductCategory!''}</g:google_product_category>
<g:product_type><#if product.googleProductType?? >${product.googleProductType?replace("&","&")!' '}</#if></g:product_type>
<g:gender>${product.gender!' '}</g:gender>
<g:color>Multicolor</g:color>
<g:size>${product.size!' '}</g:size>
<g:age_group>adult</g:age_group>
<g:custom_label_0>${product.custom_label_0!' '}</g:custom_label_0>
<g:custom_label_4>${product.custom_label_4!' '}</g:custom_label_4>
<g:shipping>
<g:country>us</g:country>
</g:shipping>
<g:content_id>${product.productId!''}</g:content_id>
</item>
</#list>
</#if>
</channel>
</rss>
US 变体模板-freemark
<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title></title>
<link></link>
<description></description>
<#if productList?? && (productList?size > 0) >
<#list productList as product>
<#if product.variants?? && (product.variants?size > 0) >
<#list product.variants as variant>
<item>
<g:id><#if variant.feedId?? >${variant.feedId}<#else>${product.productId}_${variant.variantId}_${variant.sku!''}</#if></g:id>
<g:title>${(product.title?replace('&','&'))!''}</g:title>
<g:condition>${variant.condition!''}</g:condition>
<g:description>${(product.description?replace('&','&'))!''}</g:description>
<g:mpn>${variant.mpn!''}</g:mpn>
<g:link>https://${domain.host!''}/products/${product.handle!''}?variant=${variant.variantId!''}</g:link>
<g:mobile_link>https://${domain.host!''}/products/${product.handle!''}?variant=${variant.variantId!''}</g:mobile_link>
<g:image_link>${product.imageLink!''}</g:image_link>
<g:condition>${variant.condition!''}</g:condition>
<g:availability>${variant.availability!''}</g:availability>
<g:price><#if product.firstVariant?? >${product.firstVariant.sellingPrice!''}</#if> ${storeConfig.currency!''}</g:price>
<g:brand>${variant.brand!''}</g:brand>
<g:google_product_category>${variant.googleProductCategory!''}</g:google_product_category>
<g:product_type>${(variant.googleProductType?replace('&','&'))!''}</g:product_type>
<g:gender>${variant.gender!''}</g:gender>
<g:color>${variant.color!''}</g:color>
<g:age_group>${variant.ageGroup!''}</g:age_group>
<g:custom_label_0>${(variant.customLabel0?replace('&','&'))!''}</g:custom_label_0>
<g:custom_label_4>${(variant.customLabel4?replace('&','&'))!''}</g:custom_label_4>
<g:shipping>
<g:country>us</g:country>
</g:shipping>
<g:content_id>${product.productId!''}</g:content_id>
</item>
</#list>
</#if>
</#list>
</#if>
</channel>
</rss>
US 变体模板-liquid
<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title></title>
<link></link>
<description></description>
{% for product in productList %}
{% for variant in product.variants %}
<item>
<g:id>{% if variant.feedId != null and variant.feedId != '' %}{{variant.feedId}}{% else %}{{product.productId}}_{{variant.variantId}}_{{variant.sku}}{% endif %}</g:id>
<g:title>{{product.title | replace:'&','&'}}</g:title>
<g:condition>{{variant.condition}}</g:condition>
<g:description>{{product.description | replace:'&','&'}}</g:description>
<g:mpn>{{variant.mpn}}</g:mpn>
<g:link>https://{{domain.host}}/products/{{product.handle}}?variant={{variant.variantId}}</g:link>
<g:mobile_link>https://{{domain.host}}/products/{{product.handle}}?variant={{variant.variantId}}</g:mobile_link>
<g:image_link>{{product.imageLink}}</g:image_link>
<g:condition>{{variant.condition}}</g:condition>
<g:availability>{{variant.availability}}</g:availability>
<g:price>{{product.firstVariant.sellingPrice}} {{storeConfig.currency}}</g:price>
<g:brand>{{variant.brand}}</g:brand>
<g:google_product_category>{{variant.googleProductCategory}}</g:google_product_category>
<g:product_type>{{variant.googleProductType | replace:'&','&'}}</g:product_type>
<g:gender>{{variant.gender}}</g:gender>
<g:age_group>{{variant.ageGroup}}</g:age_group>
<g:custom_label_0>{{variant.customLabel0 | replace: '&','&'}}</g:custom_label_0>
<g:custom_label_4>{{variant.customLabel4 | replace: '&','&'}}</g:custom_label_4>
<g:shipping>
<g:country>us</g:country>
</g:shipping>
<g:content_id>{{product.productId}}</g:content_id>
</item>
{% endfor %}
{% endfor %}
</channel>
</rss>
US第三方推荐-freemark
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title> </title>
<description> </description>
<link> </link>
<#if productList?? && (productList?size > 0) >
<#list productList as product>
<item>
<g:id>${product.productId}-${product.firstVariant.sku}</g:id>
<g:sku>${product.firstVariant.sku}</g:sku>
<g:product_id>${product.productId}</g:product_id>
<g:product_handle>${product.link!' '}</g:product_handle>
<g:title>${product.title?replace("&","&")}</g:title>
<g:type><#if product.productType?? >${product.productType?replace("&","&")}</#if></g:type>
<g:collection_id>${product.collectionIds!''}</g:collection_id>
<g:condition>new</g:condition>
<g:identifier_exists>no</g:identifier_exists>
<g:description><#if product.description?? >${product.description?replace("&","&")}</#if></g:description>
<g:link>https://soufeel.com/products/${product.link!''}</g:link>
<g:mobile_link>https://soufeel.com/products/${product.link!''}</g:mobile_link>
<g:image_link>${product.imageLink!''}</g:image_link>
<g:image_thumbnail>${product.imageLink!''}</g:image_thumbnail>
<g:condition>new</g:condition>
<g:availability>in stock</g:availability>
<g:sale_price>${product.firstVariant.originalPrice} ${storeConfig.currency!''}</g:sale_price>
<g:price>${product.firstVariant.sellingPrice} ${storeConfig.currency!''}</g:price>
<g:brand>Soufeel</g:brand>
<g:google_product_category>${product.googleProductCategory!' '}</g:google_product_category>
<g:product_type><#if product.googleProductType?? >${product.googleProductType?replace("&","&")}</#if></g:product_type>
<g:gender>${product.gender!' '}</g:gender>
<g:color>${product.color!' '}</g:color>
<g:age_group>adult</g:age_group>
<g:new>1</g:new>
<g:onSale>1</g:onSale>
<g:packing><#if product.tags?? && product.tags?contains('CART_GIVEAWAY')>1<#else>0</#if></g:packing>
<g:custom_label_0>${product.custom_label_0!' '}</g:custom_label_0>
<g:shipping>
<g:country>us</g:country>
</g:shipping>
</item>
</#list>
</#if>
</channel>
</rss>
US 搜索feed
<?xml version="1.0" encoding="UTF-8"?>
<products>
<#if productList?? && (productList?size > 0) >
<#list productList as product>
<#if product.tags?? && product.tags?contains('hide-product')>
<#else>
<product>
<ID>${product.productId!''}</ID>
<masterID> </masterID>
<categoryTree> </categoryTree>
<name>${product.title?replace("&","&")}</name>
<sku><#assign index = 0><#if product.variants?exists><#list product.variants as var><#if index != 0>|</#if>${var.sku?trim}<#assign index = index+1></#list></#if></sku>
<LargeImageUrl>${product.imageLink!''}</LargeImageUrl>
<ThumbnailImageUrl>${product.imageLink!''}</ThumbnailImageUrl>
<URL>${product.link!''}</URL>
<salePrice><#assign index = 0><#if product.variants?exists><#list product.variants as var><#if index != 0>|</#if>${var.sellingPrice?trim}<#assign index = index+1></#list></#if></salePrice>
<retailPrice><#assign index = 0><#if product.variants?exists><#list product.variants as var><#if index != 0>|</#if>${var.originalPrice?trim}<#assign index = index+1></#list></#if></retailPrice>
<salePriceCurrency><#assign index = 0><#if product.variants?exists><#list product.variants as var><#if index != 0>|</#if>$${var.sellingPrice?trim}<#assign index = index+1></#list></#if></salePriceCurrency>
<retailPriceCurrency><#assign index = 0><#if product.variants?exists><#list product.variants as var><#if index != 0>|</#if>$${var.originalPrice?trim}<#assign index = index+1></#list></#if></retailPriceCurrency>
<availability>instock</availability>
<gender> </gender>
<brand>SOUFEEL</brand>
<connectedProducts> </connectedProducts>
<new>1</new>
<onSale>1</onSale>
<recentPriceDrop> </recentPriceDrop>
<bestSelling>0</bestSelling>
<color>${product.color!' '}</color>
<material> </material>
<sale>${product.saleNum!0}</sale>
<packing>0</packing>
</product>
</#if>
</#list>
</#if>
</products>
最后更新于
这有帮助吗?