Developer forum

Forum » Swift » Google Console Search : Errors As Missing Name, Brand, SKU,...

Google Console Search : Errors As Missing Name, Brand, SKU,...

Cristina Santos
Reply

 

Hi everybody,
We just launched a store in swif and validation errors appear on all pages with products (lists and product details).

They are the pages where the itemtype="http://schema.org/Product" tag is.

In the Swift_Master file I have found the lines that add that tag:

// Schema.org details for PDP
string productId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : "";
bool isProductDetailsPage = !string.IsNullOrEmpty(productId);
string productDetailPageSchemaOrg = isProductDetailsPage ? "itemscope=\"\" itemtype=\"https://schema.org/Product\"" : "";
 
But I can't find a way to add the rest of the code...something like:
   {
    "@@context": "http://schema.org/",
    "@@type": "Product",
    "name": "@GetString("Ecom:Product.Name")",
    @if (!string.IsNullOrEmpty(image))
    {
        <text>"image": [
            "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@image",
            "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@image",
            "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@image"
            ],</text>
    }
    "description": "@GetString("Ecom:Product.ShortDescription")",
    "mpn": "925872",
    @if (!string.IsNullOrEmpty(brand))
    {
        <text>"brand": {
            "@@type": "Thing",
            "name": "@brand"
            },</text>
    }
    "offers": {
    "@@type": "Offer",
    "priceCurrency": "@GetString("Ecom:Product.Price.Currency.Code")",
    "price": "@GetString("Ecom:Product.Price.Price")",
    "availability": "@(GetInteger("Ecom:Product.Stock") > 0 ? "InStock" : "OutOfStock")"
    }
    }
 
What is the best way to add the missing code?
Perhaps there is some updated template to download that already includes it?
Or is it something we forgot to configure?
 
Thank you!
 
 

 


Replies

 
Cristina Santos
Reply

At the moment I have solved it by removing from Swift_ProductListGridView_Custom.cshtml the tag itemscope itemtype="https://schema.org/Product"

Before: <article class="product-list-item position-relative articlebox" itemscope itemtype="https://schema.org/Product">

Now: <article class="product-list-item position-relative articlebox">

Inside the template Swift_ProductDetailsInfo, the info is correct, because there is all the itemprops mandatory under  <main id="content" itemscope="" itemtype="https://schema.org/Product">, but inside the ProductListGrid is missing some itemprops, then GCS shows errors.

I hope this is correct.....

Best Regards

 

 

 

You must be logged in to post in the forum