feat: Enable fraction digit formatting for SEO's product:price:amount meta tag#3179
feat: Enable fraction digit formatting for SEO's product:price:amount meta tag#3179
product:price:amount meta tag#3179Conversation
WalkthroughAdds Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes 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
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. |
product:price:amount meta tag
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/core/src/pages/`[slug]/p.tsx:
- Around line 109-118: The current guard treats 0 as falsy and may pass an
out-of-range value to Number.prototype.toFixed, causing SSR errors; update the
check around productPriceAmountMetatag to allow product.offers.lowPrice === 0 by
testing for lowPrice != null and to validate pdpSeo.minPriceFractionDigits with
typeof === 'number' and clamp it to the safe toFixed range (0–20) before calling
toFixed (or skip formatting if the number is out of range), referencing
productPriceAmountMetatag, product.offers.lowPrice,
pdpSeo.minPriceFractionDigits and the toFixed call so the formatted string is
produced safely.
eduardoformiga
left a comment
There was a problem hiding this comment.
Do we need to ask the education team to document this new option?
hellofanny
left a comment
There was a problem hiding this comment.
nice!
Just to emphasize I think we should be using default and the usage of this prop is in a very specific context (customization of the schema, we could add this note and scenario in the doc to be clear)
…t` meta tag (#3179) ## What's the purpose of this pull request? With these changes, merchants will be able to choose the the minimum price fraction digits to be used on SEO's product price meta tag, preventing mismatch values between displayed product price and SEO's `product:price:amount`. ## How to test it? Check if the displayed price for any product matches with the SEO's `product:price:amount` meta tag. ### Starters Deploy Preview <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Product price meta tags (used by search engines and social previews) now support configurable decimal precision, producing consistently formatted price values for improved SEO and display. * When no precision is set, prices fall back to previous default formatting to preserve existing behavior. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Lucas Feijó <lucas.portela@vtex.com>
What's the purpose of this pull request?
With these changes, merchants will be able to choose the the minimum price fraction digits to be used on SEO's product price meta tag, preventing mismatch values between displayed product price and SEO's
product:price:amount.How to test it?
Check if the displayed price for any product matches with the SEO's
product:price:amountmeta tag.Starters Deploy Preview
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.