使用微数据格式的价格模式的正确方法是什么?

What is the correct way of using the price schema in microdata format?

我已阅读 http://schema.org/price(微数据示例),我想在我的其中一个页面上使用。

这是我感兴趣的,我想展示price/price-range

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <!--price is 1000, a number, with locale-specific thousands separator
    and decimal mark, and the $ character is marked up with the
    machine-readable code "USD" -->
    <span itemprop="priceCurrency" content="USD">$</span><span
          itemprop="price" content="1000.00">1,000.00</span>
    <link itemprop="availability" href="http://schema.org/InStock" />In stock
  </div>

现在我的页面不显示任何价格,直到在页面上选择了一些选项,但是我确实有一个基本价格(最低),我想在这种情况下使用它。

注入此基本价格的正确位置和方式是什么?

我在 https://search.google.com/structured-data/testing-tool 上试过了,效果很好。不确定这是否正确?

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <meta itemprop="priceCurrency" content="USD" />
    <meta itemprop="price" content="2.31" />
</div>

请指教

提供机器可读的值

这是无效的:

<span itemprop="priceCurrency" content="USD">$</span>
<span itemprop="price" content="1000.00">1,000.00</span>

can’t use the content attribute on every element(在 RDFa 中是可能的,但在 Microdata 中不是)。

您可以使用 data element 及其 value 属性,或使用 meta 元素,例如:

<meta itemprop="priceCurrency" content="USD" />$
<data itemprop="price" value="1000.00">1,000.00</data>

价格范围

您可以使用 PriceSpecification type to provide a price range. It allows you to use the minPrice and maxPrice 属性。

您可以添加 PriceSpecificationpriceSpecification 属性 到 Offer:

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  <div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification">
    <!-- minPrice, maxPrice, priceCurrency -->
  </div>
</div>