adampmoss / CreareSEO

A free SEO extension for Magento 1
GNU General Public License v2.0
151 stars 72 forks source link

Structured data - invalid itemOffered markup for grouped products #123

Closed bluec closed 7 years ago

bluec commented 7 years ago

The product schema creates invalid markup for grouped products which fails the Google structured data tests.

The two problems are a trailing comma and no declaration of "@type" so google assumes a "Thing" and therefore errors becauses of the SKU attribute.

Offending file: ./app/design/frontend/base/default/template/creareseo/product/schema.phtml

The output looks like this:

        "itemOffered": {
                "sku": "SOME-SKU",
                "name": "PRODUCT NAME",
        },

I believe it should look like this:

        "itemOffered": {
                "@type": "Product",
                "sku": "SOME-SKU",
                "name": "PRODUCT NAME"
        },

Note the trailing comman is removed!!

sprankhub commented 7 years ago

Thanks for the report! Just fixed it.

bluec commented 7 years ago

Thanks @sprankhub I was going to do a PR but you saved me the bother!