Repository navigation
feat: add mpn (manufacturer code) to product's structured data - #3234
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (4)
WalkthroughThe changes introduce manufacturer part number (MPN) support across the API stack. A new optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
## What's the purpose of this pull request? Adds the mpn (Manufacturer Part Number) field to the product's structured data (`ProductJsonLd`). This improves SEO by providing richer product information to search engines via Schema.org Product markup, specifically the mpn property that identifies a product to its manufacturer. ## How it works? The `manufacturerCode` field from the Intelligent Search response is exposed as `mpn` on the `StoreProduct` GraphQL type. It is then queried on the product page and passed to the `ProductJsonLd` component from next-seo. It defaults to an empty string for the products that don't have the `manufacturerCode` field on Catalog. ## How to test it? - Navigate to any product detail page (PDP). - Inspect the page source or use a tool like [Schema.org validator](https://validator.schema.org/). - Verify the JSON-LD structured data block includes an "mpn" field with the product's manufacturer code value. For products without a manufacturerCode in the IS response, confirm mpn defaults to an empty string without errors. <img width="700" alt="Screenshot 2026-03-02 at 17 49 26" src="https://github.com/user-attachments/assets/93672130-6ecf-4c88-bb4d-db55f49b5090" /> ### Starters Deploy Preview <!--- Add a link to a deploy preview from `starter.store` with this branch being used. ---> <!--- Tip: You can get an installable version of this branch from the CodeSandbox generated when this PR is created. ---> ## References - [Jira task](https://vtex-dev.atlassian.net/browse/SO-543) - [Slack thread](https://vtex.slack.com/archives/C05JYQJ94F8/p1755206247400689?thread_ts=1754663648.632859&cid=C05JYQJ94F8) - [Slack thread 2](https://vtex.slack.com/archives/C03L3CRCDC4/p1772483451655209) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Products now expose the Manufacturer Part Number (MPN) field in product information and structured data, extending available product metadata. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
What's the purpose of this pull request?
Adds the mpn (Manufacturer Part Number) field to the product's structured data (
ProductJsonLd). This improves SEO by providing richer product information to search engines via Schema.org Product markup, specifically the mpn property that identifies a product to its manufacturer.How it works?
The
manufacturerCodefield from the Intelligent Search response is exposed asmpnon theStoreProductGraphQL type. It is then queried on the product page and passed to theProductJsonLdcomponent from next-seo.It defaults to an empty string for the products that don't have the
manufacturerCodefield on Catalog.How to test it?
For products without a manufacturerCode in the IS response, confirm mpn defaults to an empty string without errors.
Starters Deploy Preview
References
Summary by CodeRabbit
Release Notes