diff --git a/lib/sylius/normalizer/cart-normalizer.ts b/lib/sylius/normalizer/cart-normalizer.ts index 30c58e97a7..fe0adaa44a 100644 --- a/lib/sylius/normalizer/cart-normalizer.ts +++ b/lib/sylius/normalizer/cart-normalizer.ts @@ -14,7 +14,7 @@ export const normalizeCart = (syliusCart: SyliusCart): Cart => { totalTaxAmount: normalizePrice(syliusCart.taxTotal), shippingAmount: normalizePrice(syliusCart.shippingTotal) }, - lines: syliusCart.items.map((item) => normalizeCartItem(item)), + lines: syliusCart.items.map(normalizeCartItem), totalQuantity: syliusCart.items.reduce((acc, item) => acc + item.quantity, 0) }; }; diff --git a/lib/sylius/normalizer/product-normalizer.ts b/lib/sylius/normalizer/product-normalizer.ts index d9e17798e1..6d28adfb8b 100644 --- a/lib/sylius/normalizer/product-normalizer.ts +++ b/lib/sylius/normalizer/product-normalizer.ts @@ -12,18 +12,18 @@ export const normalizeProduct = (product: SyliusProduct): Product => ({ title: product.name, description: product.shortDescription }, - // dont need varaints when serializing fort cart + // variants not needed for cart normalization variants: product.variants - ? product.variants.map((variant) => normalizeProductVariant(variant)) + ? product.variants.map(normalizeProductVariant) : [], - images: product.images.map((image) => normalizeProductImage(image)), + images: product.images.map(normalizeProductImage), id: product.id.toString(), handle: product.slug, availableForSale: product.variants.some((variant) => variant.inStock), title: product.name, description: product.shortDescription, descriptionHtml: product.description, - options: product.options.map((option) => normalizeProductOption(option)), + options: product.options.map(normalizeProductOption), priceRange: normalizePriceRange(product), featuredImage: normalizeProductImage(product.images[0] as SyliusProductImage), tags: [],