Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...
line 370 is here:
PHP Code:
$breadcrumb_this_page = $breadcrumb->_trail[count($breadcrumb->_trail) - 1]['title'] ?? '';
https://github.com/torvista/Zen_Cart..._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 Code:
$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.
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.
Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...
Quote:
Originally Posted by
carlwhat
line 370 is here:
PHP Code:
$breadcrumb_this_page = $breadcrumb->_trail[count($breadcrumb->_trail) - 1]['title'] ?? '';
https://github.com/torvista/Zen_Cart..._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 Code:
$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.
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.
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.
2 Attachment(s)
Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...
Quote:
Originally Posted by
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
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.
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
Re: Structured Data Markup for Schema, Facebook Open Graph, Twitter...
Quote:
Originally Posted by
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:
Code:
"brand": <?php echo json_encode($manufacturer_name); ?>,
to
Code:
"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
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",