Prestashop在Google搜索中缺少字段“价格”

问题描述 投票:0回答:1

我在Google Search Console中遇到一些错误:

Error screenshot

这里是product-list.tpl中的代码段:

{if (!$PS_CATALOG_MODE && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="content_price">
    {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
        <span itemprop="price" class="price product-price{if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0} product-price-new{/if}">
            {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
        </span>
        <meta itemprop="priceCurrency" content="{$currency->iso_code}" />
        {if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
            {hook h="displayProductPriceBlock" product=$product type="old_price"}
            <span class="old-price product-price">
                {displayWtPrice p=$product.price_without_reduction}
            </span>
            {hook h="displayProductPriceBlock" id_product=$product.id_product type="old_price"}
            {if $product.specific_prices.reduction_type == 'percentage'}
                <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span>
            {/if}
        {/if}
        {hook h="displayProductPriceBlock" product=$product type="price"}
        {hook h="displayProductPriceBlock" product=$product type="unit_price"}
    {/if}
</div>
{/if}

如何解决此错误?

schema prestashop e-commerce product
1个回答
0
投票

sreenshot代码与屏幕截图不同。请注意,在屏幕截图中,项目offers是类别spanavailability,而代码中的项目是类别divcontent_price

您需要检查此代码的来源。

然后检查Offer模式https://developers.google.com/search/docs/data-types/product

您需要添加price项目,如本例中的https://search.google.com/structured-data/testing-tool?utm_campaign=devsite&utm_medium=microdata&utm_source=product

© www.soinside.com 2019 - 2024. All rights reserved.