Zen Cart Logo
Forums / Addon Admin Tools / Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Views: 91,626

Results 141 to 160 of 212
8 Nov 2021, 5:23 PM
#141
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Nick1973:

Brilliant. Thanks for this, hopefully it will resolve the errors that are being thrown up in search console.Attachment 19801

I'm getting a duplicate Key error for @type

See the attached image.

9 Nov 2021, 7:46 PM
#142
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

I'm getting a duplicate Key error for @type
Bug for product priced by attribute. Fixed.

9 Nov 2021, 7:49 PM
#143
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

Bug for product priced by attribute. Fixed.

Cool! All my products are in without any other errors now by the way.

9 Nov 2021, 7:59 PM
#144
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

Bug for product priced by attribute. Fixed.

Ok can you tell me why this category number isn't recognised by Schema?

708 - Home & Garden > Decor > Decorative Plaques. I note in the Google Product Category entry box you have stated 6 numbers, however this one only has three?

https://www.google.com/basepages/producttype/taxonomy-with-ids.en-US.txt

9 Nov 2021, 8:03 PM
#145
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Nick1973:

Ok can you tell me why this category number isn't recognised by Schema?

708 - Home & Garden > Decor > Decorative Plaques. I note in the Google Product Category entry box you have stated 6 numbers, however this one only has three?

https://www.google.com/basepages/producttype/taxonomy-with-ids.en-US.txt

Actually it says this when I check my product, sorry I don't think it's the Google Product Category Number:

708 (The property googleProductCategory is not recognised by the schema (e.g. schema.org) for an object of type Product.)

9 Nov 2021, 10:24 PM
#146
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

As far as I can ascertain, the google product category is not part of structured data. It is part of the Google Merchant Center feed specification!
Structured data can be used by the Merchant Center instead of the direct feed, and while much of the two sources of data use the same data and identifiers, they are different animals.

So unless anyone can prove otherwise, google product category should be removed from this plugin.

9 Nov 2021, 10:39 PM
#147
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

As far as I can ascertain, the google product category is not part of structured data. It is part of the Google Merchant Center feed specification!
Structured data can be used by the Merchant Center instead of the direct feed, and while much of the two sources of data use the same data and identifiers, they are different animals.

So unless anyone can prove otherwise, google product category should be removed from this plugin.

Yes I know Merchant Center can use structured data. So far Google sees the google product category fine on my websites, so while I know technically it should be removed, it may actually be a benefit if google sees it as a positive and it helps google understand the merchants category products should be listed in.

9 Nov 2021, 10:41 PM
#148
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Sorry I missed this

in ultimate friendly URLs (not sure how the CEON one works), the anchor and the product id are the only relevant data. changing the product name does not render an invalid URL. and it will still return the correct product page as long as those pieces of information are correct.

CEON produces full text urls like this:
www .shop.com/manufacturers/eazi-grip-racing-products/dash-protectors/aprilia/dash-protector-aprilia-rs125-tuono-125-2014

so an update to a name changes the url
www .shop.com/manufacturers/eazi-grip-racing-products/dash-protectors/aprilia/dash-protector-aprilia-rs125-tuono-125-2021

and the previous one gets stored and used to redirect to the new one.

Anyway a suitable question that generally burns lots of bandwidth would be "what url to use in this plugin?"

Friendly: www .shop.com/widget
or native: www .shop.com/index.php?main_page=product_info&cPath=1_4&products_id=1

or just add another config option and let people choose?

I'm not getting involved in any discussion, others can read everything out there and eventually come up with a short and sweet conclusion, lets not have endless SEO arguments as usual.

9 Nov 2021, 10:53 PM
#149
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

Sorry I missed this

in ultimate friendly URLs (not sure how the CEON one works), the anchor and the product id are the only relevant data. changing the product name does not render an invalid URL. and it will still return the correct product page as long as those pieces of information are correct.

> 
> CEON produces full text urls like this:
> www .shop.com/manufacturers/eazi-grip-racing-products/dash-protectors/aprilia/dash-protector-aprilia-rs125-tuono-125-2014
> 
> so an update to a name changes the url
> www .shop.com/manufacturers/eazi-grip-racing-products/dash-protectors/aprilia/dash-protector-aprilia-rs125-tuono-125-2021
> 
> and the previous one gets stored and used to redirect to the new one.
> 
> Anyway a suitable question that generally burns lots of bandwidth would be "what url to use in this plugin?"
> 
> Friendly:  www .shop.com/widget
> or native: www .shop.com/index.php?main_page=product_info&cPath=1_4&products_id=1
> 
> or just add another config option and let people choose?
> 
> I'm not getting involved in any discussion, others can read everything out there and eventually come up with a short and sweet conclusion, lets not have endless SEO arguments as usual.

I think letting people choose is a better option as there are some websites that don't use SEO Friendly URL's that would only benefit from original native URL's produced by Zen Cart out of the box! I'm with you on this, it doesn't require a massive SEO Discussion or Argument that turns into something unproductive. It just needs a solution and I think your suggestion seems to be a good option.
29 Nov 2021, 1:39 AM
#150
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Hey,

Site is at https://www.royal-fleur.com

I have been using your plugins for awhile and it has been working fine.

However, i tried to update the version i had with the latest from Github and i am getting the following error:

[28-Nov-2021 16:53:44 America/Los_Angeles] PHP Parse error: syntax error, unexpected '?' in /home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/jscript/jscript_plugin_structured_data.php on line 370

If i revert to the old js_script, it works fine but i am missing some of the newer snippet/strutured data like aggregaterating

Any help with this would be appreciated.

Thank you

29 Nov 2021, 3:29 AM
#151
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,967
Plugin Contributions:
8

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

line 370 is here:

$breadcrumb_this_page = $breadcrumb->_trail[count($breadcrumb->_trail) - 1]['title'] ?? '';

https://github.com/torvista/Zen_Cart-Structured_Data/blob/ac297f44d7c4b2e7e60fd7a2f4f27ed4cd5f22e3/files/includes/templates/YOUR_TEMPLATE/jscript/jscript_plugin_structured_data.php#L370

my guess is the you are running a version of php less than 7.0 which makes use of the coalesce (??) operator.

if so, you probably should upgrade your php version and perhaps your version of ZC as php versions less than 7.0 have been end of life for quite some time.

alternatively, you could try changing the code to:

$breadcrumb_this_page = '';
if (isset($breadcrumb->_trail[count($breadcrumb->_trail) - 1]['title']) {
   $breadcrumb_this_page = $breadcrumb->_trail[count($breadcrumb->_trail) - 1]['title'];
}

if line 370 is something different, feel free to ignore everything i said!

best.

29 Nov 2021, 11:37 AM
#152
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

My bad, I do forget to set my IDE back to 5.6. Fix pushed.

2 Dec 2021, 3:56 AM
#153
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

carlwhat:

line 370 is here:

$breadcrumb_this_page = $breadcrumb->_trail[count($breadcrumb->_trail) - 1]['title'] ?? '';

> 
> <https://github.com/torvista/Zen_Cart-Structured_Data/blob/ac297f44d7c4b2e7e60fd7a2f4f27ed4cd5f22e3/files/includes/templates/YOUR_TEMPLATE/jscript/jscript_plugin_structured_data.php#L370>
> 
> my guess is the you are running a version of php less than 7.0 which makes use of the coalesce (??) operator.
> 
> if so, you probably should upgrade your php version and perhaps your version of ZC as php versions less than 7.0 have been end of life for quite some time.  
> 
> alternatively, you could try changing the code to:
> 
> ```php
$breadcrumb_this_page = '';
if (isset($breadcrumb->_trail[count($breadcrumb->_trail) - 1]['title']) {
   $breadcrumb_this_page = $breadcrumb->_trail[count($breadcrumb->_trail) - 1]['title'];
}

if line 370 is something different, feel free to ignore everything i said!

best.

Thank you.

2 Dec 2021, 4:08 AM
#154
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

I spoke too fast. I am getting another error:

--> PHP Parse error: syntax error, unexpected '{' in /home/zch1akhw6q3m/public_html/includes/templates/Royal_Fleur/jscript/jscript_plugin_structured_data.php on line 371.

Sorry for the noob question. I don't know anything about coding. And you are correct. I am on a PHP 5.6 with ZC 1.5.6 version
. My whole site is due for an update but i haven't managed to get on it yet.

2 Dec 2021, 11:33 AM
#155
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

First check you are using the current file from GitHub.
If the error persists, please paste what is on the referenced line of the file.

12 Dec 2021, 11:35 PM
#156
nicksab avatar

nicksab

Totally Zenned

Join Date:
Apr 2011
Posts:
592
Plugin Contributions:
0

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

torvista:

First check you are using the current file from GitHub.
If the error persists, please paste what is on the referenced line of the file.

I got the updated version from github and it fixed my previous issue.

I am having another problem. ( see screenshot)

All my product have a 3 star rating on google but i don t have any product review.

Where is it taking the review rating from?

Also the date showing for the review is the date the product was first added to the store.

Any ideas regarding the 3 star on all my products??

the store is at royal-fleur.com

Any help will appreciated thank you

Attachment 19854Attachment 19855

15 Dec 2021, 1:30 PM
#157
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Reviews: that's to prevent a load of Google Rich Tool warnings about no reviews. I've updated the Github readme on this.

13 Feb 2022, 11:48 PM
#158
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Hi Steve - I am using your latest version of Structured Data downloaded from GitHub recently on a V1.5.7b site and all is good with just this one query - in all cases Google is flagging a 'warning' for products in testing the markup via Google Rich Results ... 'Invalid object type for field "brand" .... this is auto filled correctly and when testing using https://validator.schema.org/ there are no warnings.

So just wondering if there was a fix for this or is it simply Google being google?

cheers, Mike

14 Feb 2022, 10:13 AM
#159
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

shags38:

Hi Steve - I am using your latest version of Structured Data downloaded from GitHub recently on a V1.5.7b site and all is good with just this one query - in all cases Google is flagging a 'warning' for products in testing the markup via Google Rich Results ... 'Invalid object type for field "brand" .... this is auto filled correctly and when testing using https://validator.schema.org/ there are no warnings.

So just wondering if there was a fix for this or is it simply Google being google?

cheers, Mike

Although I haven't kept up with the latest updates for this plugin, I think (my notes aren't great) that I had to add a 'Brand' object type. In jscript_plugin_structured_data.php I changed:

"brand": <?php echo json_encode($manufacturer_name); ?>,

to

"brand" : {
              "@type" : "Brand",
               "name" : <?php echo json_encode($manufacturer_name); ?>
                },

With this I don't get a Brand warning in https://search.google.com/test/rich-results

14 Feb 2022, 5:30 PM
#160
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,874
Plugin Contributions:
7

Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...

Just tested one of my products. No errors.
This is the relevant html generated. Using same code as GitHub.

"googleProductCategory": "2788",
"brand": {
"@type" : "Brand",
"name" : "Scottoiler"
},
"category" : "Spare Parts",