New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove microdata in html flow => replace per JSON-LD for classic theme #23042
Conversation
Hello @fdonnet! This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community! |
hey @fdonnet I appreciate your job, I created an issue in order to discuss a bit with the team about it ! #23046 Sanity are broken because they're based on itemprop attributes (wow), we'll need to change this because we'll never accept to mix itemprop and a separate file at the same time, if we choose to separate concerns, then let's go deeper :) |
This comment has been minimized.
This comment has been minimized.
@fdonnet Hi! You can now put a proper mpn in the data, we have the field since 1.7.7. 😎 |
This comment has been minimized.
This comment has been minimized.
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
"url": "{$item.url}" | ||
}{if !$smarty.foreach.producttmp.last},{/if} | ||
{/foreach}] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
] | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I think I m ok with the open and close "}" and "]" I don't understand your correction. :)
themes/classic/templates/catalog/_partials/miniatures/product.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/catalog/_partials/miniatures/product.tpl
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some feedback
Ok, thanks for following feedbacks There are few more feedbacks about code styles, newlines, also, care about sanity tests (@boubkerbribri @nesrineabdmouleh, this PR changes a bit the markup, maybe we'll need to add selectors in order to avoid breaking tests, as you were using attributes selectors) Also please, add new line at every file's end, and then I think we are almost good :) |
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
themes/classic/templates/_partials/microdata/product-jsonld.tpl
Outdated
Show resolved
Hide resolved
Rebase for real "inital proposition", history of commits squashed because not very relevant (code cleaning, file separation). See, if we keep the product combinations declared as Offer or if we limit the scope to a simple Offer per product and let the shop owners override this template to fit their real needs (depending on their shop config => url rewrite etc) ? At the end, the goal is to pass Google Rich text validator without (a lot) of warning to limit the creation of SEO issues in Github ;)... so maybe the combinations part in product-jsonld.tpl try to enhance a bit to much. (sad) ? |
@fdonnet I think you can push the first part of changes without the combinations, so we have it sorted. We can then make proper research on how to approach this. I don't think it will consider it as duplicate, if it has proper canoncial. I will study it.
No my friend, the goal is to make the best SEO, destroy the competition and squeeze the most money out of people. 😄 |
Sure like you mentionned in a comment above, if we can have the $combination.url it can help to declare the combinations as offer. But not sure if it's sufficient
Héhé 👍 For sure, for the little shops I dev for, I will let the combinations part (because I have one url per product) and I already cross-checked that Google give more "impressions" with that and people find products the never found in the past. So it 's great. But I don't want to create weird side effects for normal Prestashop base configurations. Let see what is the opinion of others... PS : UI Test failed => because of the itemprop removal (even with the new selectors) |
@fdonnet @NeOMakinG Every resource I found on the internet just talks about one offer, and if the product has variants, they just say to add Aggregateoffers and specify min max price. Do we even have proper prices in They have separate offers here, but no URL??? 😄 https://www.schemaapp.com/newsletter/schema-org-variable-products-productmodels-offers/ IMHO, if you push it now without the combinations, it would be perfectly fine. And then you can just tweak that one file. WDYT? |
hello @nesrineabdmouleh, maybe you or someone else can help me to fix the UI tests ?
(new selector) . Strange because this tag is visible in my PR ? |
Hello @fdonnet, Ok I will fix the UI tests problem. |
@nesrineabdmouleh
In my PR, I only removed all itemprop attributes (old UI selector) but apparently the new one is not working. |
@fdonnet, you're welcome!
Your branch has conflicts, you should resolve them before fixing UI tests. |
@nesrineabdmouleh oh yes sry didn't see it, thx |
@Hlavtox version without combination pushed, a little bit sad :) I think if we don't specify an url for combination it will raise a unnecessary Google warning. And we know how our lovely shop owners hate Google warnings even if it's not very relevant ;) |
@nesrineabdmouleh Hello again |
Hello @fdonnet, the error is not related to our tests, maybe there is a problem in FO with PHP 7.4 |
@nesrineabdmouleh it seems linked to a selector : page.waitForSelector: Timeout 10000ms exceeded. ? strange ? |
It cannot find the selector of Product name on product FO page, maybe there is a problem in the page. |
@NeOMakinG hi, maybe you can help us on that (php7.4 test failed) ? |
Hi @fdonnet, please check the screenshot of the error https://github.com/PrestaShop/PrestaShop/suites/1966830440/artifacts/39072336 I think it's related to your PR. |
@boubkerbribri thx, i will investigate tomorrow ;) |
PLS SEE => #23151 |
The goal of this PR is to open the discussion about the microdata management.
A lot of issues are open about this topic recently.
The proposition is to keep the meta tags in the html flow but remove the microdata information and create a specific file that centralizes all the microdata and use JSON-LD for the declaration.
inspired a lot by github =>prestarocket-agence/classic-rocket
themes/classic/templates/_partials/microdata-jsonld.tpl :
This file is included in the head.tpl.
For the moment it's not perfect but it centralizes the info for futher improvements.
It takes care of this kind of microdata
Edit : not included product ratings/review (need smarty var for combinations)
The product JSON declaration is not perfect (no EAN or other specific things). But like explained it's to open the discussion about the "centralization" of the concept and after that, maybe people who go deep;) will create new smarty variables that will help to enrich the microdata declaration. => For now, to have a product offer for each comination on the prouct page, it's great... I think.
I use this template on 2 shops and I can see a good amount of new "Google impressions" ... people find comibnations (colors, flavors) too. => solve the problem when you have single cannonical url per product and your combinations will be skipped by Google bot.
Other files => remove each instance of itemprop and itemscope
Trick for pagination pages
Hope it will help...
This change is