英文:
JSON-LD product page markup for multiple currencies?
问题
我在想是否有一个带有多个“priceCurrency”和“price”的产品页面的工作示例。如果我们有两个地区和它们的价格,而且只有一个域名,是否可以结构化JSON-LD以同时包含价格和货币?类似这样:
"offers": {
"@type": "Offer",
"priceCurrency": "GBP",
"price": "219.95",
"availability": "https://schema.org/InStock"
},
"offers": {
"@type": "Offer",
"priceCurrency": "EUR",
"price": "200",
"availability": "https://schema.org/InStock"
}
提前感谢。
英文:
I was wondering if there is a working example of a product page with multiple "priceCurrency" and "price". If we have two regions and prices for them and one domain is it possible to structure json-ld to have both prices and currencies? Something like this:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
"offers": {
"@type": "Offer",
"priceCurrency": "GBP",
"price": "219.95",
"availability": "https://schema.org/InStock"
},
"offers": {
"@type": "Offer",
"priceCurrency": "EUR",
"price": "200",
"availability": "https://schema.org/InStock"
},
<!-- end snippet -->
Thanks in advance.
答案1
得分: 1
是的,您可以通过使用数组声明多个报价来实现。以下是您修改后的示例:
"offers": [
{
"@type": "Offer",
"priceCurrency": "GBP",
"price": "219.95",
"availability": "https://schema.org/InStock"
},
{
"@type": "Offer",
"priceCurrency": "EUR",
"price": "200",
"availability": "https://schema.org/InStock"
}
]
英文:
Yes, you can do that by declaring multiple offers using an array. This is your modified example:
"offers": [
{
"@type": "Offer",
"priceCurrency": "GBP",
"price": "219.95",
"availability": "https://schema.org/InStock"
},
{
"@type": "Offer",
"priceCurrency": "EUR",
"price": "200",
"availability": "https://schema.org/InStock"
}
]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论