在Schema.org中显示折扣 [英] Show discount in Schema.org

查看:129
本文介绍了在Schema.org中显示折扣的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个降价的产品。我想要显示两种价格 - 原价和折扣价。有没有办法在Schema.org中标记这个?

I have a product which has reduced price. I want to show both prices - original and discounted. Is there a way to mark this in 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 


推荐答案

您当前的加价不会传达哪个价格是旧的/新的。你不应该使用它。

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

你可以使用两个 PriceSpecification 项目(作为 priceSpecification的值) 财产)。使用 validFrom validThrough 您可以指定旧价格有效的日期以及新价格有效的日期。

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>

(注意 span 元素可以'在Microdata中有一个 content 属性。我用 meta 元素替换它。)

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

这篇关于在Schema.org中显示折扣的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆