5

値下げした商品があります。元の価格と割引後の価格の両方を表示したい。Schema.org でこれをマークする方法はありますか?

今のところ、私は似たようなものを持っています:

<ul class="productPriceList" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer">
     <li class="productPriceList">
         <div class="price red"><span class="" itemprop="price">4302</span>&nbsp;<span itemprop="priceCurrency" content="USD">$</span></div>
         <span class="price crossOut" itemprop="price">26890</span>&nbsp;<span itemprop="priceCurrency" content="USD">$</span>&nbsp;<span class="product-promo">84</span>%&nbsp;off
     </li>                  
</ul>

これは次のように表示されます。

offers  
     @type: Offer
     price: 4302
     priceCurrency: USD 
     price: 26890
     priceCurrency: USD 
4

1 に答える 1

5

Your current markup doesn’t convey which price is the old/new one. You shouldn’t use that.

You could use two PriceSpecification items instead (as value for the priceSpecification property). With validFrom and validThrough you can specify the dates when the old price was valid and since when the new price is valid.

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">

  <div itemprop="priceSpecification" itemscope itemtype="PriceSpecification">
    <s>$ <span itemprop="price">26890</span></s>
    <meta itemprop="priceCurrency" content="USD" />
    <meta itemprop="validThrough" content="…" />
  </div>

  <div itemprop="priceSpecification" itemscope itemtype="PriceSpecification">
    $ <span itemprop="price">4302</span>
    <meta itemprop="priceCurrency" content="USD" />
    <meta itemprop="validFrom" content="…" />
  </div>

</div>

(Note that the span element can’t have a content attribute in Microdata. I replaced it with a meta element.)

于 2016-06-16T14:58:44.207 に答える