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

时间:2017-04-12 10:34:51

标签: schema.org microdata

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

这是我感兴趣的,我想显示价格/价格范围

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

enter image description here

请建议。

1 个答案:

答案 0 :(得分:4)

提供机器可读的值

这是无效的:

<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类型提供价格范围。它允许您使用minPricemaxPrice属性。

您可以将PriceSpecification Offer属性添加到<div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification"> <!-- minPrice, maxPrice, priceCurrency --> </div> </div>

ops.metal
相关问题