Normalizing Cart Responses

This commit is contained in:
Belen Curcio
2021-01-12 16:59:07 -03:00
parent 287e690495
commit fc34856e50
8 changed files with 54 additions and 30 deletions

View File

@@ -3,11 +3,6 @@ export type SelectedOptions = {
color: string | null
}
export type ProductOption = {
displayName: string
values: any
}
export function getVariant(product: Product, opts: SelectedOptions) {
const variant = product.variants.find((variant) => {
return Object.entries(opts).every(([key, value]) =>