JSON-LD产品页面多货币标记?

huangapple go评论48阅读模式
英文:

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 -->

&quot;offers&quot;: {
  &quot;@type&quot;: &quot;Offer&quot;,
  &quot;priceCurrency&quot;: &quot;GBP&quot;,
  &quot;price&quot;: &quot;219.95&quot;,
  &quot;availability&quot;: &quot;https://schema.org/InStock&quot;
},
&quot;offers&quot;: {
  &quot;@type&quot;: &quot;Offer&quot;,
  &quot;priceCurrency&quot;: &quot;EUR&quot;,
  &quot;price&quot;: &quot;200&quot;,
  &quot;availability&quot;: &quot;https://schema.org/InStock&quot;
},

<!-- 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:

&quot;offers&quot;: [
    {
        &quot;@type&quot;: &quot;Offer&quot;,
        &quot;priceCurrency&quot;: &quot;GBP&quot;,
        &quot;price&quot;: &quot;219.95&quot;,
        &quot;availability&quot;: &quot;https://schema.org/InStock&quot;
    },
    {
        &quot;@type&quot;: &quot;Offer&quot;,
        &quot;priceCurrency&quot;: &quot;EUR&quot;,
        &quot;price&quot;: &quot;200&quot;,
        &quot;availability&quot;: &quot;https://schema.org/InStock&quot;
    }
]

huangapple
  • 本文由 发表于 2023年2月8日 22:30:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75387261.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定