adampmoss / CreareSEO

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

Parsing error: Missing '}' or object member name #153

Closed simoncrewe closed 5 years ago

simoncrewe commented 5 years ago

Hi, Google search console reported unparsable structured data.

I've added data shown from https://codebeautify.org/jsonvalidator Parse error on line 18: ...y Tailored", }, "priceCurr ----------------------^ Expecting 'STRING', got '}'

Here is my schema: Many thanks

{ "@context": "http://schema.org", "@type": "Product", "description": "Please scroll down to view the front & rear seat options", "name": "Fully Tailored Seat Covers For The Ford Transit Courier", "image": "https://stormtight.co.uk/media/catalog/product/f/u/fully-tailored-driver-bench-van-seat-covers-black.jpg", "sku": "2072", "url": "https://stormtight.co.uk/ford-transit-courier-fully-tailored-seat-covers", "offers": [

            {
                    "@type": "Offer",
        "availability": "InStock",
        "itemOffered": {
                "sku": "3120C"  ,
                "name": "Front 2 Single Ford Transit Courier Fully Tailored",
        },
        "priceCurrency": "GBP",
        "price": "149.95"
    } 

   ]

}

sprankhub commented 5 years ago

Looks like you are using an old version of the extension. Please update to the latest version and make sure that you do not override any templates in your custom theme.

simoncrewe commented 5 years ago

Hi, I've added latest version but it's still the same. Error seems to be the comma at the end of "name". "name": "Front 2 Single Ford Transit Courier Fully Tailored", If comma is deleted, the json schema shows no errors.

Please advise

Cheers,

Simon

sprankhub commented 5 years ago

As you see here

https://github.com/adampmoss/CreareSEO/blob/2051d687c4c86ad7d9efe57638318119e360a33e/app/design/frontend/base/default/template/creareseo/product/schema.phtml#L45

there is no comma at the end of the line. So either you do not use the latest version or you override the template.

There is indeed a little gotcha. If you use an official release, the comma is still present. So please use the latest master version. It is definitely fixed there.

simoncrewe commented 5 years ago

Hi Simon,

All working Cheers, Simon Crewe

On Monday, May 20, 2019, 2:49:02 PM GMT+2, Simon Sprankel <notifications@github.com> wrote:  

As you see here

https://github.com/adampmoss/CreareSEO/blob/2051d687c4c86ad7d9efe57638318119e360a33e/app/design/frontend/base/default/template/creareseo/product/schema.phtml#L45

there is no comma at the end of the line. So either you do not use the latest version or you override the template.

There is indeed a little gotcha. If you use an official release, the comma is still present. So please use the latest master version. It is definitely fixed there.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.