refactor calculation code

- implement fee
- centralize the code
This commit is contained in:
2025-10-27 08:08:22 +03:00
parent 251e7a9369
commit cd49a3756f
13 changed files with 395 additions and 284 deletions

View File

@@ -2,8 +2,8 @@ import { message } from "antd";
import {
clearCart,
selectCart,
selectCartTotalWithLoyaltyDiscount,
selectHighestPricedLoyaltyItem,
selectGrandTotal,
selectHighestPricedLoyaltyItem
} from "features/order/orderSlice";
import { useCallback } from "react";
import { useTranslation } from "react-i18next";
@@ -37,7 +37,7 @@ export default function useOrder() {
const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem);
const { useLoyaltyPoints } = useAppSelector(selectCart);
const orderPrice = useAppSelector(selectCartTotalWithLoyaltyDiscount);
const orderPrice = useAppSelector(selectGrandTotal);
const [createOrder] = useCreateOrderMutation();