mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Merge remote-tracking branch 'origin' into core-return
This commit is contained in:
@@ -362,6 +362,10 @@ const reshapeCollection = (collection: ShopifyCollection): Collection | undefine
|
||||
helpfulLinks: parseMetaFieldValue<string[]>(collection.helpfulLinks),
|
||||
helpfulLinksTop: parseMetaFieldValue<string[]>(collection.helpfulLinksTop),
|
||||
dynamicContent: collection.dynamicContent?.value || null,
|
||||
plpType: collection.plpType?.value || null,
|
||||
lhnLinks: parseMetaFieldValue<string[]>(collection.lhnLinks),
|
||||
engineSizeLinks: parseMetaFieldValue<string[]>(collection.engineSizeLinks),
|
||||
transmissionCodeLinks: parseMetaFieldValue<string[]>(collection.transmissionCodeLinks),
|
||||
path: getCollectionUrl(collection.handle)
|
||||
};
|
||||
};
|
||||
@@ -906,7 +910,6 @@ export async function getAllMetaobjects(type: string) {
|
||||
while (hasNextPage) {
|
||||
const res = await shopifyFetch<ShopifyMetaobjectsOperation>({
|
||||
query: getMetaobjectsQuery,
|
||||
tags: [TAGS.collections, TAGS.products],
|
||||
variables: { type, after }
|
||||
});
|
||||
|
||||
|
@@ -18,6 +18,18 @@ const collectionFragment = /* GraphQL */ `
|
||||
dynamicContent: metafield(namespace: "custom", key: "plp_content") {
|
||||
value
|
||||
}
|
||||
plpType: metafield(namespace: "custom", key: "plp_type") {
|
||||
value
|
||||
}
|
||||
lhnLinks: metafield(namespace: "custom", key: "lhn_links") {
|
||||
value
|
||||
}
|
||||
engineSizeLinks: metafield(namespace: "custom", key: "engine_size_links") {
|
||||
value
|
||||
}
|
||||
transmissionCodeLinks: metafield(namespace: "custom", key: "transmission_code_links") {
|
||||
value
|
||||
}
|
||||
updatedAt
|
||||
}
|
||||
${seoFragment}
|
||||
|
@@ -44,12 +44,22 @@ export type CartItem = {
|
||||
|
||||
export type Collection = Omit<
|
||||
ShopifyCollection,
|
||||
'helpfulLinks' | 'helpfulLinksTop' | 'dynamicContent'
|
||||
| 'helpfulLinks'
|
||||
| 'helpfulLinksTop'
|
||||
| 'dynamicContent'
|
||||
| 'plpType'
|
||||
| 'lhnLinks'
|
||||
| 'engineSizeLinks'
|
||||
| 'transmissionCodeLinks'
|
||||
> & {
|
||||
path: string;
|
||||
helpfulLinks: string[] | null;
|
||||
helpfulLinksTop: string[] | null;
|
||||
dynamicContent: string | null;
|
||||
plpType: PLPType | null;
|
||||
lhnLinks: string[] | null;
|
||||
engineSizeLinks: string[] | null;
|
||||
transmissionCodeLinks: string[] | null;
|
||||
};
|
||||
|
||||
export type Customer = {
|
||||
@@ -509,6 +519,14 @@ export type ShopifyCart = {
|
||||
totalQuantity: number;
|
||||
};
|
||||
|
||||
export type PLPType =
|
||||
| 'Product Type'
|
||||
| 'Make'
|
||||
| 'Model'
|
||||
| 'Year'
|
||||
| 'Transmission Code'
|
||||
| 'Engine Size';
|
||||
|
||||
export type ShopifyCollection = {
|
||||
handle: string;
|
||||
title: string;
|
||||
@@ -518,6 +536,10 @@ export type ShopifyCollection = {
|
||||
helpfulLinks: { value: string } | null;
|
||||
helpfulLinksTop: { value: string } | null;
|
||||
dynamicContent: { value: string } | null;
|
||||
plpType: { value: PLPType } | null;
|
||||
lhnLinks: { value: string } | null;
|
||||
engineSizeLinks: { value: string } | null;
|
||||
transmissionCodeLinks: { value: string } | null;
|
||||
};
|
||||
|
||||
export type ShopifyProduct = {
|
||||
|
Reference in New Issue
Block a user