product page: get selected variant price instead of main product price
This commit is contained in:
@@ -7,13 +7,13 @@ import { useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAppDispatch, useAppSelector } from "redux/hooks";
|
||||
import { colors, ProBlack2 } from "ThemeConstants";
|
||||
import { Product } from "utils/types/appTypes";
|
||||
import { Product, Variant } from "utils/types/appTypes";
|
||||
import styles from "../product.module.css";
|
||||
|
||||
export default function ProductFooter({
|
||||
product,
|
||||
isValid = true,
|
||||
variantId,
|
||||
selectedVariant,
|
||||
selectedExtras,
|
||||
selectedGroups,
|
||||
quantity,
|
||||
@@ -21,7 +21,7 @@ export default function ProductFooter({
|
||||
}: {
|
||||
product: Product;
|
||||
isValid?: boolean;
|
||||
variantId: string;
|
||||
selectedVariant?: Variant;
|
||||
selectedExtras: string[];
|
||||
selectedGroups: string[];
|
||||
quantity: number;
|
||||
@@ -60,11 +60,11 @@ export default function ProductFooter({
|
||||
item: {
|
||||
id: product?.id,
|
||||
name: product?.name,
|
||||
price: product?.price,
|
||||
price: selectedVariant?.price || product?.price,
|
||||
image: product?.image,
|
||||
description: product?.description,
|
||||
comment: specialRequest,
|
||||
variant: variantId,
|
||||
variant: selectedVariant?.id,
|
||||
extras: selectedExtras,
|
||||
extrasgroup: selectedGroups,
|
||||
isHasLoyalty: product?.isHasLoyalty,
|
||||
|
||||
Reference in New Issue
Block a user