Hi @webwitnl,
So if I got it correctly, products that are not available are listed as available and some that are available are listed as Not available?
As a next step, provide the System Status Report and then, head to WooCommerce > Status > Logs and in a dropdown, find a Google Listings & Ads error. Select, that, click view, copy the log and send it to us.
To share your current System Status Report. You can get it by navigating to the WooCommerce / Status section of your site. Once there, click on the Get system report button and then copy it by clicking on the Copy for support button. Then paste it here in a comment.
Thanks!
I’ve investigated a bit more, and I think the bug is elsewhere, in the schema.org JSON that wp-content/plugins/woocommerce/includes/class-wc-structured-data.php generates in my pages.
It’s probably that Google scrapes such a product page that they got from Google Listings & Ads, and then compares data.
class-wc-structured-data seems a bit lame, if you have a product with variations it only outputs one item instead of one for each variation. Then on line 262 it does this:
‘availability’ => ‘http://schema.org/’ . ( $product->is_in_stock() ? ‘InStock’ : ‘OutOfStock’ ),
Function is_in_stock returns true if one variation is in stock but the others aren’t.
That JSON also doesn’t include GTIN and all your fields, so Google seems confused.
Hey @webwitnl,
Could you please share what you are currently seeing in the logs (full logs)? Looking at your reply above, it sounds like you have something in the logs that can understand what is happening.
What version of the Google Listings & Ads plugin do you have active?
Also, please confirm if my understanding earlier about the sync problem is correct or if I missed anything.
“So if I got it correctly, products that are not available are listed as available and some that are available are listed as Not available?”
No, only products that are not available are listed as available.
Log shows no errors, just that products are successfully committed. I have the latest versions of everything.
But are you sure you are appreciating the problem correctly? It is not a bug in submitted the products to google.
P.S. I tried Yoast Premium to see if they insert the schema.org JSON the right way for variations, but same thing. A google search stuff like people having the same problems two years ago, they would look into it, but still not fixed.
Basically, whether it is Woocommerce or Yoast who creates it, they should follow https://www.schemaapp.com/schema-markup/schema-org-variable-products-productmodels-offers/ , and instead of one offer under “offers”, they should have multiple for each variation, and move GTIN, availability etc. under the offer instead of the parent.
In defense of Google Listings & Ads, the plugin does it right, it’s that other plugins don’t. I probably need to go elsewhere and complain 😉
Oh well. It’s concerning that Woocommerce and plugins have so much trouble getting product variations right in 2022. I probably have to hook in somewhere and cook my own schema.
-
This reply was modified 4 years, 1 month ago by
webwitnl.
Hi @webwitnl
Thank you for explaining – you have indeed hit on the problem that WooCommerce developers have marked as high priority in the WooCommerce repository at Schema: Variable product schema structured data getting disapproved.
You can subscribe to the issue on Github to get upates on their progress with it.
We’re glad to hear Google Listings & Ads is performing well for you.