Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions commerce/sections/Seo/SeoPDPV2.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Seo from "../../../website/components/Seo.tsx";
import {
OGType,
renderTemplateString,
SEOSection,
} from "../../../website/components/Seo.tsx";
Expand All @@ -25,6 +26,11 @@ export interface Props {
* @description By default, Structured Data is sent to everyone. Use this to prevent Structured Data from being sent to your customers, it will still be sent to crawlers and bots. Be aware that some integrations may not work if Structured Data is not sent.
*/
ignoreStructuredData?: boolean;
/**
* @title OG Type
* @default product
*/
type?: OGType;
}

/** @title Product details */
Expand All @@ -41,6 +47,7 @@ export function loader(_props: Props, _req: Request, ctx: AppContext) {
jsonLD,
omitVariants,
ignoreStructuredData,
type: typeProp,
} = props;

const title = renderTemplateString(
Expand Down Expand Up @@ -75,6 +82,7 @@ export function loader(_props: Props, _req: Request, ctx: AppContext) {
canonical,
noIndexing,
jsonLDs,
type: typeProp ?? "product",
};
}

Expand Down
2 changes: 1 addition & 1 deletion website/components/Seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const renderTemplateString = (template: string, value: string) =>
template.replace("%s", value);

export type SEOSection = JSX.Element;
export type OGType = "website" | "article";
export type OGType = "website" | "article" | "product";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Discord and Slack admin preview components render an empty div when OG type is "product". The preview UI won't show a preview card for PDPs in the admin panel. Add a type === "product" branch (or broaden the fallback) in both components so the admin preview still shows content for product pages.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At website/components/Seo.tsx, line 10:

<comment>Discord and Slack admin preview components render an empty div when OG type is "product". The preview UI won't show a preview card for PDPs in the admin panel. Add a `type === "product"` branch (or broaden the fallback) in both components so the admin preview still shows content for product pages.</comment>

<file context>
@@ -7,7 +7,7 @@ export const renderTemplateString = (template: string, value: string) =>
 
 export type SEOSection = JSX.Element;
-export type OGType = "website" | "article";
+export type OGType = "website" | "article" | "product";
 
 export interface Props {
</file context>


export interface Props {
title?: string;
Expand Down
Loading