outeredge / magento-structured-data-module

Magento Structured Data Module by outer/edge
MIT License
46 stars 13 forks source link

Add itemOffered #59

Closed barryvdh closed 9 months ago

barryvdh commented 9 months ago

This adds itemOffered to offers, mostly for the children of configurable products. See https://schema.org/itemOffered

I'm not sure if this is the actual standard, but our marketing agency recommended this. I would like to add color/model myself, but I'll create a plugin for that (see #58)

barryvdh commented 9 months ago

I guess the actual correct way would be to have the Configurable as a ProductGroup? https://schema.org/ProductGroup And then have the variesBy listing the properties (eg. size/color) and adding that to the itemOffered as ProductModel https://schema.org/ProductModel ?

vseager commented 9 months ago

@barryvdh thanks for your suggestion and contribution. It is possible to group products where you have a product entity (see inProductGroupWithID for https://schema.org/ProductModel).

However, the schema.org vocabulary is vast and it whilst it would be possible to create a perfectly interlinked web of all entities involved as per the schema.org standard, the purpose of this module is only really to satisfy Google, who in reality only utilises a small selection of the Schema.org standard within it's own structured data requirements.

As per Google's doc's below it doesn't looks like Google is interested in the itemOffered or inProductGroupWithID: https://developers.google.com/search/docs/appearance/structured-data/product (_Although it does request item_group_id in the merchant center product feed_)

With Google ranking on so many factors, including page load times and things like DOM size, it's in our interest to keep the markup as minimal as possible whilst meeting Google's requirements: https://developer.chrome.com/en/docs/lighthouse/performance/dom-size/

Therefore, I can't see that this MR adds any benefit to the module at the moment (although happy to be proven wrong if that's not the case).

You're welcome to extend it to meet your own requirements though if they differ!

barryvdh commented 9 months ago

Yes thanks, I'll create a Plugin to extend it for my specific use-case, although I can't really see any recommendations from it from Google either indeed.