-
تخفیف تمدید خودکار (۵٪):
-
فعال
+
+ رزرو هوشمند تمدید دوره (۵٪ پاداش خرید بعدی):
+ ثبت و رزرو گردید
)}
{Number(selectedOrder.charityDonation || 0) > 0 && (
diff --git a/frontend/application/components/CheckoutPage.tsx b/frontend/application/components/CheckoutPage.tsx
index 82b8d0f..4e0a43b 100644
--- a/frontend/application/components/CheckoutPage.tsx
+++ b/frontend/application/components/CheckoutPage.tsx
@@ -413,9 +413,9 @@ export default function CheckoutPage() {
{toPersian(getSubtotal().toLocaleString())} تومان
{isSubscribed && (
-
-
تخفیف اشتراک (۵٪-)
-
{toPersian(getDiscount().toLocaleString())} تومان
+
+ رزرو هوشمند تمدید (پاداش ۵٪ خرید بعدی):
+ رزرو شد ({toPersian(Math.round(getSubtotal() * 0.05).toLocaleString())} تومان)
)}
{charityDonation > 0 && (
diff --git a/frontend/application/components/OrderDetailsModal.tsx b/frontend/application/components/OrderDetailsModal.tsx
index 65c6c47..e235fad 100644
--- a/frontend/application/components/OrderDetailsModal.tsx
+++ b/frontend/application/components/OrderDetailsModal.tsx
@@ -325,9 +325,9 @@ export default function OrderDetailsModal({ isOpen, onClose, order }: OrderDetai
{toPersian(itemsSubtotal.toLocaleString())} تومان
{isRefill && (
-
-
تخفیف تمدید خودکار (۵٪):
-
{toPersian(refillDiscount.toLocaleString())}- تومان
+
+ رزرو هوشمند تمدید (۵٪ پاداش خرید بعدی):
+ فعال ({toPersian(Math.round(itemsSubtotal * 0.05).toLocaleString())} تومان)
)}
{charityAmount > 0 && (
diff --git a/frontend/application/lib/store/cartStore.ts b/frontend/application/lib/store/cartStore.ts
index 7089791..9afa28f 100644
--- a/frontend/application/lib/store/cartStore.ts
+++ b/frontend/application/lib/store/cartStore.ts
@@ -165,7 +165,7 @@ export const useCartStore = create
()(
getSubtotal: () => get().items.reduce((acc, item) => acc + item.product.priceValue * item.quantity, 0),
getDiscount: () => {
const subtotal = get().getSubtotal();
- let discount = get().isSubscribed ? subtotal * 0.05 : 0;
+ let discount = 0;
if (get().coupon) {
const c = get().coupon!;
@@ -178,6 +178,10 @@ export const useCartStore = create()(
return Math.min(discount, subtotal);
},
+ getNextOrderReward: () => {
+ const subtotal = get().getSubtotal();
+ return get().isSubscribed ? Math.round(subtotal * 0.05) : 0;
+ },
getTotal: () => get().getSubtotal() - get().getDiscount() + get().charityDonation,
}),
{ name: "canina-cart" }