Skip to content
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

render json ld to products metadata sheet #105

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hannessolo
Copy link
Collaborator

@hannessolo hannessolo commented Sep 19, 2024

Copy link

aem-code-sync bot commented Sep 19, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented Sep 19, 2024

Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

}

if (amount?.value && amount?.currency) {
schema.offers.push({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a SimpleProductView we can add a single offer like done here. For a ComplexProductView we should add all available variants.

For this we can use a query like this:

{
  variants(sku: "MJ12", optionIds: [], pageSize: 100) {
    variants {
      selections
      product {
        sku
        inStock
        __typename
        images(roles: "image") {
          url
        }
        ... on SimpleProductView {
          price {
            ...priceFields
          }
        }
      }
    }
    cursor
  }
}

If desired by the customer this could also be limited to specific variant axis (e.g. show color variants, but not the size ones).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this was done in the client-side setJsonLd so far:

Should we update the client side function too?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I think we were actually waiting for the variants query to be available on prod CS. If you can re-use the same code, feel free to update PDP as well. Otherwise we can also handle it in a separate issue.

tools/pdp-metadata/pdp-metadata.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants