refactor calculation code
- implement fee - centralize the code
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user