mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
link dynamic content to a collection
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
@@ -358,6 +358,7 @@ const reshapeCollection = (collection: ShopifyCollection): Collection | undefine
|
||||
...collection,
|
||||
helpfulLinks: parseMetaFieldValue<string[]>(collection.helpfulLinks),
|
||||
helpfulLinksTop: parseMetaFieldValue<string[]>(collection.helpfulLinksTop),
|
||||
dynamicContent: collection.dynamicContent?.value || null,
|
||||
path: getCollectionUrl(collection.handle)
|
||||
};
|
||||
};
|
||||
|
@@ -15,6 +15,9 @@ const collectionFragment = /* GraphQL */ `
|
||||
helpfulLinksTop: metafield(namespace: "custom", key: "helpful_links_top") {
|
||||
value
|
||||
}
|
||||
dynamicContent: metafield(namespace: "custom", key: "plp_content") {
|
||||
value
|
||||
}
|
||||
updatedAt
|
||||
}
|
||||
${seoFragment}
|
||||
|
@@ -42,10 +42,14 @@ export type CartItem = {
|
||||
addOnProduct?: CartItem & { quantity: number };
|
||||
};
|
||||
|
||||
export type Collection = Omit<ShopifyCollection, 'helpfulLinks' | 'helpfulLinksTop'> & {
|
||||
export type Collection = Omit<
|
||||
ShopifyCollection,
|
||||
'helpfulLinks' | 'helpfulLinksTop' | 'dynamicContent'
|
||||
> & {
|
||||
path: string;
|
||||
helpfulLinks: string[] | null;
|
||||
helpfulLinksTop: string[] | null;
|
||||
dynamicContent: string | null;
|
||||
};
|
||||
|
||||
export type Customer = {
|
||||
@@ -513,6 +517,7 @@ export type ShopifyCollection = {
|
||||
updatedAt: string;
|
||||
helpfulLinks: { value: string } | null;
|
||||
helpfulLinksTop: { value: string } | null;
|
||||
dynamicContent: { value: string } | null;
|
||||
};
|
||||
|
||||
export type ShopifyProduct = {
|
||||
|
Reference in New Issue
Block a user