This commit is contained in:
karl 2025-03-26 15:58:58 -04:00
parent e6fe47bbe1
commit e8d5b6e789

View File

@ -1,31 +1,51 @@
export type SortFilterItem = { export type SortFilterItem = {
title: string; title: string
slug: string | null; slug: string | null
sortKey: 'RELEVANCE' | 'BEST_SELLING' | 'CREATED_AT' | 'PRICE'; sortKey: 'RELEVANCE' | 'BEST_SELLING' | 'CREATED_AT' | 'PRICE'
reverse: boolean; reverse: boolean
}; }
export const defaultSort: SortFilterItem = { export const defaultSort: SortFilterItem = {
title: 'Relevance', title: 'Relevance',
slug: null, slug: null,
sortKey: 'RELEVANCE', sortKey: 'RELEVANCE',
reverse: false reverse: false,
}; }
export const sorting: SortFilterItem[] = [ export const sorting: SortFilterItem[] = [
defaultSort, defaultSort,
{ title: 'Trending', slug: 'trending-desc', sortKey: 'BEST_SELLING', reverse: false }, // asc {
{ title: 'Latest arrivals', slug: 'latest-desc', sortKey: 'CREATED_AT', reverse: true }, title: 'Trending',
{ title: 'Price: Low to high', slug: 'price-asc', sortKey: 'PRICE', reverse: false }, // asc slug: 'trending-desc',
{ title: 'Price: High to low', slug: 'price-desc', sortKey: 'PRICE', reverse: true } sortKey: 'BEST_SELLING',
]; reverse: false,
}, // asc
{
title: 'Latest arrivals',
slug: 'latest-desc',
sortKey: 'CREATED_AT',
reverse: true,
},
{
title: 'Price: Low to high',
slug: 'price-asc',
sortKey: 'PRICE',
reverse: false,
}, // asc
{
title: 'Price: High to low',
slug: 'price-desc',
sortKey: 'PRICE',
reverse: true,
},
]
export const TAGS = { export const TAGS = {
collections: 'collections', collections: 'collections',
products: 'products', products: 'products',
cart: 'cart' cart: 'cart',
}; }
export const HIDDEN_PRODUCT_TAG = 'nextjs-frontend-hidden'; export const HIDDEN_PRODUCT_TAG = 'nextjs-frontend-hidden'
export const DEFAULT_OPTION = 'Default Title'; export const DEFAULT_OPTION = 'Default Title'
export const SHOPIFY_GRAPHQL_API_ENDPOINT = '/api/2023-01/graphql.json'; export const SHOPIFY_GRAPHQL_API_ENDPOINT = `https://${process.env.SHOPIFY_STORE_DOMAIN}/api/2023-01/graphql.json`