2016-08-12 70 views
3

因此,我已經用結構化數據完全標記了我的產品頁面。我們有點卡住了我們的一些網頁。我們的價格範圍上的一些產品頁面的喜歡:標出價格範圍Schema.org

£2.99 - £7.99

我們如何去設置此功能,我們已經成功地使用下面的代碼

<span itemprop="priceCurrency" >£</span> 
<span itemprop="price" >44.00</span> 
不設置價格的產品

如果任何人都可以幫助,這將是驚人的。

在此先感謝。

+0

在http://schema.org/PriceSpecification上有'minPrice' /'maxPrice'。 – Caramiriel

+0

@ Caramiriel:你不想創建一個答案嗎? :) – unor

+0

我不熟悉模式的,我只是想輕推在哪裏看:) – Caramiriel

回答

1

下面是使用JSON-LD版本:

<script type="application/ld+json"> 
{ 
    "@context": "http://schema.org/", 
    "@type": "Offer", 
    "name": "", 
    "itemOffered": { 
     "@type": "Product", 
     "name": "", 
     "description": "" 
    }, 
    "priceSpecification": { 
     "@type": "PriceSpecification", 
     "price": "4.99", 
     "minPrice": "2.99", 
     "maxPrice": "7.99", 
     "priceCurrency": "GBP" 
    } 
} 
</script> 

@unor不妨使用微顯示一個版本。

2

您可以使用PriceSpecification,minPricemaxPrice這兩個屬性。 Google也要求價格屬性,因此我將價格作爲minPrice包含在下面的代碼片段中。

<div itemscope itemtype="http://schema.org/Offer"> 
    <span itemprop="name">Offer Name</span> 
    <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Product"> 
     <span itemprop="name">Product Name</span> 
     <span itemprop="description">Product Description</span> 
    </div> 
    <div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification"> 
     £<span itemprop="price minPrice">5.49</span>– 
     £<span itemprop="maxPrice">7.99</span> 
     (<span itemprop="priceCurrency">GBP</span>) 
    </div> 
</div>