0

我们在 Magento 有一个网上商店,里面有很多分组产品。分组产品页面包含基本信息,然后是包含所有产品的表格。此表包含每一行的 SKU、一些属性和价格。我想向其中添加元数据(来自schema.org),但我不确定如何执行此操作。

我通过为该表中的每一行添加一个 itemtype 产品来尝试它,但这不会以任何方式链接到产品名称。我也尝试将整个页面制作成产品,但这并没有给出预期的结果。

有没有人遇到过这个问题并解决了?欢迎任何意见!

我正在处理的页面:clickie

4

1 回答 1

1

事实上,在每一行中,您都有一些不同的产品(直径、长度等不同)。理想情况下,您应该使用嵌套在schema.org/Offer中的schema.org/Product来表明这一点,并使用itemref与一般产品信息链接。像这样:

<div id="product_general">
    <h1 itemprop="name" >Induweb spiraalboor, HSS, Rolgewalst, DIN 338, type N</h1>
</div>

<div itemscope itemtype="http://schema.org/Offer">
    <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Product" itemref="product_general">
        <span itemprop="model">Diameter: 1.0</span>
    </div>
    <span itemprop="Price">€ 0,13</span>
</div>

这里的问题是您正在使用表格来获取特定产品和报价信息。似乎没有办法在您当前的设计中使用有效的 html 代码进行上述构造。但是,如果您正在寻找更多的丰富片段而不是超级正确的标记,这对您来说不是一个大问题。

因此,您现在对 Rich Snippets 的问题是最高价格不正确。 在此处输入图像描述

您可以使用schema.org/AggregateOffer轻松解决这个问题。在您当前的代码(精简版)中:

<div class="wrapper product-view" itemscope itemtype="http://schema.org/Product">

    <h1 itemprop="name" id="product_name">Induweb spiraalboor, HSS, Rolgewalst, DIN 338, type N</h1>
    <img itemprop="image" src="http://induweb.nl/media/catalog/product/cache/1/image/185x/5e06319eda06f020e43594a9c230972d/import/Verspanen/Boren/Cylindrische schacht/100000002-induweb-spiraalboor-hss-rolgewalst-din-338-type-n_0/induweb.nl--100000002-30.jpg" alt="Induweb spiraalboor, HSS, Rolgewalst, DIN 338, type N" title="Induweb spiraalboor, HSS, Rolgewalst, DIN 338, type N" />
    <table><tr><td itemprop="brand">InduWeb</td></tr></table>
    <div  itemprop="description">
                        <p>&middot; Rolgewalst <br />&middot; Cilinderschacht <br />&middot; Rechtssnijdend <br />&middot; Kegelmantelgeslepen 118&deg; <br />&middot; Zwarte uitvoering</p>                    </div>

    <!-- Put http://AggregateOffer here with high and low price properties-->
    <div itemprop="offers" itemscope itemtype="http://schema.org/AggregateOffer">
        <meta itemprop="lowPrice" content="€ 0,13">
        <meta itemprop="highPrice" content="€ 1.75">
        <meta itemprop="offerCount" content="98">
    </div>
    <!-- End of AggregateOffer-->    

    <table>
    <tr itemscope itemtype="http://schema.org/Offer" itemprop="offers">
        <td itemprop="sku">
            <div class="shipping shipping-176" itemprop="availability" content="in_stock"></div>
            100010006
        </td>

        <!-- Start sub attributen -->
        <!--  -->
        <td class="a-center">1.0</td>
        <!--  -->
        <td class="a-center">34</td>
        <!--  -->
        <td class="a-center">12</td>
        <!-- Einde sub attributen -->

        <td class="a-center" style="width: 25px;"><p>10</p></td>

        <td>
            <span itemprop="price">
                <span class="price">€ 0,13</span>
            </span>
        </td>
    </tr>
    </table>
</div>

虽然它在语义上不是超级正确,但它会给出相当好的结果:

在此处输入图像描述

于 2013-08-18T08:49:35.923 回答