2

我的数据遍布各处,因此我无法保持这种格式:

<div itemscope itemtype="http://schema.org/Product">
    <h1 itemprop="name">
    <p itemprop="description">
    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
             <span itemprop="price">      
    </div>
</div>  

就像您在下面的代码中看到的那样,页面上的第一件事是类别路径,它必须在 Offer 架构内,而不是我拥有属于 Product 的图像和标题,而不是我拥有再次属于 Offer 的合格数量等等。 ...所以我添加了:

<div itemscope itemtype="http://schema.org/Product">

在页面的开头并在最后关闭它,而不是每当我有一个不属于产品模式的元素时,例如“eligibleQuantity”,我会这样做:

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
      {L_901}: <span itemprop="eligibleQuantity">{QTY}</span><br />
      </div>

问题是我不知道这是否是正确的方法,也想不出另一种方法。我还收到“警告:schema.org 的微数据不完整”。这是该页面的链接:

https://www.pchounds.com/item.php?id=82627#.UTi7kRz_mSp

下面是页面中的一些代码,所以你可以知道我做了什么。谢谢你。

<div itemscope itemtype="http://schema.org/Product">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="breadcrumb"> {L_041}:<span itemprop="category"> {TOPCATSPATH}</span> </div>

...........................................................................................
!-- IF B_HASIMAGE -->
<div class="span3" style="text-align:center"> <img class="img-polaroid" itemprop="image"
   src="{SITEURL}getthumb.php?w={THUMBWIDTH}&fromfile={PIC_URL}" border="0" alt="title" align="center"><br>
<h1 itemprop="name" style="line-height:24px;">{TITLE}</h1>...........................................................................................
<!-- IF QTY gt 1 -->
  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  {L_901}: <span itemprop="eligibleQuantity">{QTY}</span><br />
  </div>
  <!-- ENDIF -->
  <!-- IF B_HASENDED -->
  {L_904}<br />
  <!-- ENDIF -->  
  <!-- IF ITEM_CONDITION -->
   <b> {L_1036}:</b> <span itemprop="itemCondition">{ITEM_CONDITION}</span><br /> 
    <!-- ENDIF -->  
   <!-- IF ITEM_MANUFACTURER --> 
  <b> {L_1037}:</b> <span itemprop="manufacturer">{ITEM_MANUFACTURER}</span><br />                      
  <!-- ENDIF -->
  <!-- IF ITEM_MODEL -->
  <b> {L_1038}:</b> <span itemprop="mpn">{ITEM_MODEL}</span><br />
  <!-- ENDIF -->
  <!-- IF ITEM_COLOUR -->
  <b> {L_1039}:</b> <span itemprop="color">{ITEM_COLOUR}</span><br />                                                
  <!-- ENDIF -->
  <!-- IF ITEM_YEAR -->
  <b> {L_1040}:</b> {ITEM_YEAR}<br />
  <!-- ENDIF -->  
   </small>  
4

1 回答 1

0

报价必须有价格,<span itemprop="price">后面必须跟价格的价值,但不是,而且应该只有一个报价时有多个报价。查看 Google 结构化数据测试工具的当前测试结果,有 5 个错误,每个错误都表明价格缺失

问题似乎是报价的每个部分在开始时都有一个单独的“ http://schema.org/Offer ” - 所以它预计有 5 个价格,5 个报价中的每一个都有一个。

您需要做的是声明http://schema.org/Offer' **once**, for example an extra` 在添加所有报价值之前保持打开状态。

<div itemscope itemtype="http://schema.org/Product">
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
 <div class="breadcrumb"> Item category:<span itemprop="category"> <a href="https://www.pchounds.com/browse.php?id=1">All</a> > <a href="https://www.pchounds.com/browse.php?id=313">Electronics</a> > <a href="https://www.pchounds.com/browse.php?id=857">Audio</a> > <a href="https://www.pchounds.com/browse.php?id=879">Audio Components</a> > <a href="https://www.pchounds.com/browse.php?id=899">Speakers</a></span>    
 </div>
 <div class="row">
   <div class="span3" style="text-align:center"> <img class="img-polaroid" itemprop="image" src="https://www.pchounds.com/getthumb.php?w=120&fromfile=uploaded/82627/82627.jpg" border="0" alt="title" align="center"><br>
   </div>
  </div>
 </div>
 <div class="span5">
 <h1 itemprop="name" style="line-height:24px;">Creative Labs Speaker GigaWorks T20 Series II Systems 2.0 EPS complian</h1>
 <div><!-- schema.org/Offer removed -->
  <em>
  <p><small>Buy Now:    
  <span itemprop="price"><b>108.91</b> <a href="https://www.pchounds.com/converter.php?AMOUNT=108.91" alt="converter" class="new-window">USD</a></span></small></p> 
  </em> 
 </div>

<div class="span5">
<h1 itemprop="name" style="line-height:24px;">Creative Labs Speaker GigaWorks T20 Series II Systems 2.0 EPS complian</h1>
 <div> <!-- removed http://schema.org/Offer -->
 <em>
 <p><small>Buy Now:    
 <span itemprop="price"><b>108.91</b> <a href="https://www.pchounds.com/converter.php?AMOUNT=108.91" alt="converter" class="new-window">USD</a></span></small></p> 
 </em> 
 </div>
 Shipping fee: <b>8.00</b> <a href="https://www.pchounds.com/converter.php?AMOUNT=8.00" alt="converter" class="new-window">USD</a><br />
 <small>Ends within:
 <span id="ending_counter"><span class="errfont">closed</span></span><br />
 <p> Seller location: United States<br />
  <div> <!-- removed http://schema.org/Offer -->
  <b>Payment methods:</b><span itemprop="acceptedPaymentMethod"> PayPal</span> </p>
 </div>
  </small>

... 

</div>
于 2015-08-12T22:45:09.480 回答