我可以同时使用Offer和AggregateOffer吗?

问题描述 投票:1回答:1

我有一个产品页面,产品可以从不同的卖家购买。

我在seperatesAggregateOffer之间看到了Google Offer,好像我应该选择那个标签或另一个。

我尝试使用这两种方式,并且在使用Google工具进行测试时返回了标记错误,因为我使用了两次offers

{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "MyName",
  "image": [
    "https://www.example.com/image1.jpg",
    "https://www.example.com/image2.jpg"
   ],
  "offers": {
    "@type": "AggregateOffer",
    "lowPrice": "100",
    "highPrice": "150",
    "priceCurrency": "USD",
    "offerCount": "3"
  }

      "offers": {
    "@type": "Offer",
    "url": "https://www.example.com/page/",
    "priceCurrency": "USD",
    "price": "100",
    "itemCondition": "https://schema.org/NewCondition",
    "availability": "https://schema.org/InStock",
    "itemOffered": "Thing"
  }

}

我希望尽可能多地提供信息,据谷歌称,availability等信息适用于Offer而不是AggregateOffer

所以我有两个选择:

要么只使用上述Offer标记中的一个,要么使用AggregateOffer并在其中添加像availability这样的字段,即使我没有在任何地方看到这个例子。

什么会更好?

schema.org google-rich-snippets
1个回答
0
投票

一个AggregateOffer可以引用它的所有Offer项目:

{
  "@context": "https://schema.org/",
  "@type": "Product",

  "offers": {
    "@type": "AggregateOffer",
    "offerCount": 3,

    "offers": [
      {
        "@type": "Offer"
      },
      {
        "@type": "Offer"
      },
      {
        "@type": "Offer"
      }
    ]

  }

}

Google’s documentation about AggregateOffer称,谷歌的产品丰富的结果不使用Offer所包含的个别AggregateOffer项目。

还要注意AggregateOffer可以拥有Offer可以拥有的所有属性(如availability),因为Offer是父类型,但是这些属性然后适用于聚合商品本身,而不是它所包含的个别商品,因此大多数这些属性都不包括在这种背景下有意义。

© www.soinside.com 2019 - 2024. All rights reserved.