我的数据遍布各地,所以我不能保留这种格式:
<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的标题,而不是我拥有的qualQuantity再次属于Offer和等...... 所以我添加了:
<div itemscope itemtype="http://schema.org/Product">
在页面的开头并在最后关闭它,而且每当我有一个不属于产品架构的元素时,例如“qualifiedQuantity”,我会这样做:
<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>
答案 0 :(得分: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>