问题描述
我有一个降价的产品。我想要显示两种价格 - 原价和折扣价。有没有办法在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> <span itemprop="priceCurrency" content="USD">$</span></div>
<span class="price crossOut" itemprop="price">26890</span> <span itemprop="priceCurrency" content="USD">$</span> <span class="product-promo">84</span>% 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.
你可以使用两个项目(作为财产)。使用和您可以指定旧价格有效的日期以及新价格有效的日期。
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中显示折扣的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!