diff --git a/.env.example b/.env.example index 75213ad42..d59223a7c 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ -COMPANY_NAME="Vercel Inc." -TWITTER_CREATOR="@vercel" +COMPANY_NAME=" " +TWITTER_CREATOR=" " TWITTER_SITE="https://nextjs.org/commerce" -SITE_NAME="Next.js Commerce" +SITE_NAME="WKND Commerce" SHOPIFY_REVALIDATION_SECRET= SHOPIFY_STOREFRONT_ACCESS_TOKEN= SHOPIFY_STORE_DOMAIN= diff --git a/lib/shopify/adventures.ts b/lib/shopify/adventures.ts index 9f2b14aba..619ae8cf6 100644 --- a/lib/shopify/adventures.ts +++ b/lib/shopify/adventures.ts @@ -544,12 +544,63 @@ export function transformToProduct(adventure: any): Product { { name: 'activity', value: adventure.activity }, { name: 'adventureType', value: adventure.adventureType }, { name: 'tripLength', value: adventure.tripLength }, - { name: 'groupSize', value: adventure.groupSize }, - { name: 'difficulty', value: adventure.difficulty } + { name: 'Group Size', value: 'Normal' } + // { name: 'difficulty', value: adventure.difficulty } ], price }; + const smallGroupVariant = { + id: 'smallGroupVariant', + title: 'Small Group', + availableForSale: true, + selectedOptions: [ + { + name: 'Group Size', + value: 'Small' + } + ], + price: price + }; + + const normalGroupVariant = { + id: 'normalGroupVariant', + title: 'Normal Group', + availableForSale: true, + selectedOptions: [ + { + name: 'Group Size', + value: 'Normal' + } + ], + price: price + }; + + const largeGroupVariant = { + id: 'largeGroupVariant', + title: 'Large Group', + availableForSale: true, + selectedOptions: [ + { + name: 'Group Size', + value: 'Large' + } + ], + price: price + }; + + const groupSizeProductOption = { + id: 'groupSizeProductOption', + name: 'Group Size', + values: ['Small', 'Normal', 'Large'] + }; + + const durationProductOption = { + id: 'durationProductOption', + name: 'Stay Duration', + values: ['Short', 'Normal', 'Extended Stay'] + }; + const product: Product = { id, handle, @@ -557,7 +608,7 @@ export function transformToProduct(adventure: any): Product { title: adventure.title, description: adventure.description.html, descriptionHtml: adventure.itinerary.html, - options: [], // No clear mapping for options from the given input + options: [groupSizeProductOption], priceRange: { maxVariantPrice: price, minVariantPrice: price @@ -575,7 +626,8 @@ export function transformToProduct(adventure: any): Product { description: adventure.description.html }, tags: [], - variants: [], + //variants: { edges: [{ node: mockProductVariant }] }, + variants: [smallGroupVariant, normalGroupVariant, largeGroupVariant], updatedAt: new Date().toISOString() };