Oksydan / falcon

Prestashop starter theme that provides great development experience.
GNU General Public License v3.0
257 stars 61 forks source link

🐛 [BUG] - Some fix to do for the Product microdata #357

Open maofree opened 11 months ago

maofree commented 11 months ago

Description

Hi now I've seen that it is necessary to do some fixes for the Product microdata

these are missing: priceValidUntil itemCondition

for priceValidUntil I used this solution <meta itemprop="priceValidUntil" content="{"+1 year"|date_format:"%Y-%m-%d"}">

these are new requested microdata hasMerchantReturnPolicy shippingDetails

12 11

looking into StructuredDataProductPresenter.php I have seen that priceValidUntil and itemCondition have some condition

to priceValidUntil it is necessary to set my suggestion if not present a specific price because google needs that info for itemCondition it should be https://schema.org/NewCondition if the first condition is not accepted

many websites are without the stock management active

for this moment I've fixed so

111

Node.js version

v16

php version

8.1

OS and it's version

linux

Browsers

Chrome

Required module/theme

theme

Reproduction steps

1. Look a product page from Google search console or from validator.schema.org

Logs

No response

maofree commented 11 months ago

alerted also prestashop https://github.com/PrestaShop/PrestaShop/issues/34813

Oksydan commented 11 months ago

Hi @maofree

thb it's not a valid solution. priceValidUntil - should be filled only when needed. In our case for time limited promotions. It's working properly via json+ld in is_themecore module https://github.com/Oksydan/is_themecore/blob/main/src/Core/StructuredData/Presenter/StructuredDataProductPresenter.php#L121-L123 I don't think we need to change anything.

I am closing this issue, thank you for your contribution.

Oksydan commented 11 months ago

Actually I am going to reopen this 😄. Yes, you are right about itemCondition. We will fix this in the next version.

hasMerchantReturnPolicy, shippingDetails - this is too specific to the store return policy and shipping methods, we would need a lot of configuration for this 🤔. ATM I do not plan to implement this.

maofree commented 10 months ago

Hi @Oksydan I know that priceValidUntil is joined to a specific price, but I don't trust Google and I have a doubt, why highlight warnings about a lack of data if this is limited only to timed offers? Maybe because schema.org is an "offer" and therefore expects an expiration date for the offer? When in doubt I prefer not to have warnings

maofree commented 10 months ago

Hi a guy have answered from prestashop topic with this example


Oksydan commented 10 months ago

Like I said it will required to create a lot of configuration. Like returnPolicy per product or per category, default and also per country. There is a lot of stuff we have to consider while implementing this structural data. It's optional field in product, so atm it's like the lowest priority task.

BTW, you can decorate this data with hooks. So you can create a module that implements a hook to populate this data.