diff --git a/src/assets/locals/ar.json b/src/assets/locals/ar.json index f487684..b942b4d 100644 --- a/src/assets/locals/ar.json +++ b/src/assets/locals/ar.json @@ -277,7 +277,10 @@ "am": "ص", "pm": "م", "cannotSelectPastDate": "لا يمكنك اختيار تاريخ سابق. يرجى اختيار اليوم أو تاريخ مستقبلي.", - "checkRequiredFields": "يرجى التحقق من الحقول المطلوبة" + "checkRequiredFields": "يرجى التحقق من الحقول المطلوبة", + "loyalty": "ولاء", + "vatTax": "ضريبة (القيمة المضافة)", + "otherTaxes": "ضريبة (أخرى)" }, "checkout": { "addCarDetails": "إضافة تفاصيل السيارة", diff --git a/src/assets/locals/en.json b/src/assets/locals/en.json index ad75a41..4df99b4 100644 --- a/src/assets/locals/en.json +++ b/src/assets/locals/en.json @@ -295,7 +295,9 @@ "cannotSelectPastDate": "You cannot select a past date. Please select today or a future date.", "checkRequiredFields": "Please check required fields", "applyYourAvailableRewardsToGetDiscountsOnItemsInYourCart": "Apply your available rewards to get discounts on items in your cart", - "loyalty": "Loyalty" + "loyalty": "Loyalty", + "vatTax": "Tax (Vat)", + "otherTaxes": "Tax (Other)" }, "checkout": { "addCarDetails": "Add Car Details", diff --git a/src/components/OrderSummary/OrderSummary.tsx b/src/components/OrderSummary/OrderSummary.tsx index 988b50b..24ca1ce 100644 --- a/src/components/OrderSummary/OrderSummary.tsx +++ b/src/components/OrderSummary/OrderSummary.tsx @@ -6,15 +6,13 @@ import { selectDiscountTotal, selectGrandTotal, selectHighestPricedLoyaltyItem, - selectLoyaltyValidation, selectTaxAmount, - updateUseLoyaltyPoints, } from "features/order/orderSlice"; import { OrderType } from "pages/checkout/hooks/types"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; import { useGetRestaurantDetailsQuery } from "redux/api/others"; -import { useAppDispatch, useAppSelector } from "redux/hooks"; +import { useAppSelector } from "redux/hooks"; import ProText from "../ProText"; import ProTitle from "../ProTitle"; import styles from "./OrderSummary.module.css"; @@ -25,7 +23,7 @@ export default function OrderSummary() { const { useLoyaltyPoints, splitBillAmount } = useAppSelector(selectCart); const { subdomain } = useParams(); const { data: restaurant } = useGetRestaurantDetailsQuery(subdomain); - const { orderType, tip } = useAppSelector(selectCart); + const { orderType } = useAppSelector(selectCart); const subtotal = useAppSelector(selectCartTotal); const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem); const taxAmount = useAppSelector(selectTaxAmount); @@ -46,6 +44,8 @@ export default function OrderSummary() { textAlign: "center", }; + const vat = (restaurant?.vat ?? 0) / 100 * subtotal || 0 + return ( <> @@ -159,10 +159,21 @@ export default function OrderSummary() { {orderType !== OrderType.Redeem && (
- {t("cart.tax")} + {t("cart.vatTax")} +
+ )} + {orderType !== OrderType.Redeem && ( +
+ + {t("cart.otherTaxes")} + +