I have following piece of code:

<tr><th>Availability:</th>
  <td><link itemprop="availability" href="http://schema.org/InStock"/>available</td></tr>
<tr><th>Price:</th>
  <td itemprop="price">$137</td></tr>
<meta itemprop="priceCurrency" content="USD" />
</tbody>

Unfortunately, it doesn't validate: Start tag meta seen in table.

How can I insert price currency and have validation correct?

有帮助吗?

解决方案

You could put the meta element in the td and move the price property to a span (otherwise the price value would include the string "USD").

<tr>
  <th>Price:</th>
  <td>
    <span itemprop="price">137</span>
    <meta itemprop="priceCurrency" content="USD" />
  </td>
</tr>

其他提示

A little suggestion to @unor 's answer. Item property "price" should not contain any sign but numbers.

Use the priceCurrency property (with ISO 4217 codes e.g. "USD") instead of including ambiguous symbols such as '$' in the value.

ref: http://schema.org/price

So

<span itemprop="price">$137</span>

this line should be this

<span itemprop="price">137</span>

The answer above is correct. Another possible way would be:

<tr>
  <th>Price:</th>
    <td>
      <span itemprop="price">$137</span> 
        (<abbr title="United States Dollars" itemprop="priceCurrency">USD</abbr>)
    </td>
</tr>

By specifically making the "USD" visible to the website visitor then you eliminate any possible confusion for your visitor as to what currency the "$" refers to (US dollars, Canadian dollars, Australian dollars, etc)

<div itemscope itemtype="http://schema.org/Product">
  <meta itemprop="name" content="product name" />
  <meta itemprop="gtin14" content="00886227537143" />
  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <meta itemprop="price" content="55.00" />
    <meta itemprop="priceCurrency" content="USD" />
    <meta itemprop="availability" content="http://schema.org/InStock" />
    <meta itemprop="itemCondition" content="http://schema.org/NewCondition" />
  </div>
</div>

It is important to include schema.org/offer:

<tr itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  <th>Price:</th>   
  <td><span>$</span><span itemprop="price">137</span>
    <meta itemprop="priceCurrency" content="USD" />   
  </td> 
</tr>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top