我正在从电子商店写一篇文章给Facebook。
到目前为止一切顺利。 Feed是XML格式,引用提供了一个示例,并且Feed中项目中的送货字段的格式为:
<g:shipping>
<g:country>UK</g:country>
<g:service>Standard</g:service>
<g:price>4.95 GBP</g:price>
</g:shipping>
但是,引用声明格式应该是逗号分隔的字符串,如下所示:
Blob with different prices for each country and region.
Different regions are comma-separated.
The format should be COUNTRY:STATE:SHIPPING_TYPE:PRICE.
e.g.
US:CA:Ground:9.99 USD, US:NY:Air:15.99 USD
你是否抓住了这个矛盾?
如果我尝试使用我的Feed:
<g:shipping>US:CA:Ground:9.99 USD, US:NY:Air:15.99 USD</g:shipping>
我收到错误,该国家或价格缺失。
所以,我必须坚持样本。
问题是:
在Feed中提供多个送货区域的正确方法是什么?
调试工具here根本没有帮助......
我是否重复g:shipping
字段集?
<g:shipping>
<g:country>UK</g:country>
<g:service>Standard</g:service>
<g:price>4.95 GBP</g:price>
</g:shipping>
<g:shipping>
<g:country>US</g:country>
<g:service>Standard</g:service>
<g:price>5.30 GBP</g:price>
</g:shipping>
我是否在字段集中进行迭代?
<g:shipping>
<g:country>UK</g:country>
<g:service>Standard</g:service>
<g:price>4.95 GBP</g:price>
<g:country>US</g:country>
<g:service>Standard</g:service>
<g:price>5.30 GBP</g:price>
</g:shipping>
或者,如果有的话,在切换到CSV之前我必须要做多个区域(我不想这样做,但是如果有的话,我会这样做:CSV支持多个逗号分隔格式区域)?
答案 0 :(得分:0)
我在这里回答此事以供将来参考。
Facebook使用的模板是Google Merchant Center提供的模板。
如上所述here
Include the optional sub-attributes if you need them.
To specify a shipping cost for different delivery locations,
submit multiple shipping attributes including the relevant sub-attributes.
<g:shipping>
<g:country>US</g:country>
<g:region>MA</g:region>
<g:service>Ground</g:service>
<g:price>6.49 USD</g:price>
</g:shipping>
<g:shipping>
<g:country>US</g:country>
<g:region>MA</g:region>
<g:service>Express</g:service>
<g:price>15.99 USD</g:price>
</g:shipping>