apply coupon discount

This commit is contained in:
2025-11-09 21:58:56 +03:00
parent b327d16260
commit 4389d267d4
8 changed files with 160 additions and 103 deletions

View File

@@ -3,6 +3,7 @@ import ArabicPrice from "components/ArabicPrice";
import {
selectCart,
selectCartTotal,
selectDiscountTotal,
selectGrandTotal,
selectHighestPricedLoyaltyItem,
selectLoyaltyValidation,
@@ -30,6 +31,7 @@ export default function OrderSummary() {
const highestLoyaltyItem = useAppSelector(selectHighestPricedLoyaltyItem);
const taxAmount = useAppSelector(selectTaxAmount);
const grandTotal = useAppSelector(selectGrandTotal);
const discountAmount = useAppSelector(selectDiscountTotal);
const isHasLoyaltyGift =
(restaurant?.loyalty_stamps ?? 0) -
@@ -54,13 +56,7 @@ export default function OrderSummary() {
)}
<div className={styles.summaryRow}>
<ProText type="secondary">{t("cart.discount")}</ProText>
<ArabicPrice
price={
useLoyaltyPoints && restaurant?.is_loyalty_enabled === 1
? highestLoyaltyItem?.price || 0
: 0
}
/>
<ArabicPrice price={discountAmount} />
</div>
<div className={styles.summaryRow}>
<ProText type="secondary">{t("cart.tax")}</ProText>