fix: unify free shipping threshold to 10000 RSD across all pages

- Create centralized shipping config file (src/lib/config/shipping.ts)
- Update CartDrawer.tsx: change hardcoded 5000 to FREE_SHIPPING_THRESHOLD_RSD constant
- Update TickerBar.tsx: change hardcoded 10000 to use centralized constant
- Ensure uniform free shipping messaging across all pages and localizations
This commit is contained in:
Unchained
2026-04-09 11:55:55 +02:00
parent 011994b36e
commit 864008af16
3 changed files with 55 additions and 3 deletions
+3 -2
View File
@@ -9,6 +9,7 @@ import { useTranslations, useLocale } from "next-intl";
import { useSaleorCheckoutStore } from "@/stores/saleorCheckoutStore";
import { formatPrice } from "@/lib/saleor";
import { useAnalytics } from "@/lib/analytics";
import { FREE_SHIPPING_THRESHOLD_RSD } from "@/lib/config/shipping";
export default function CartDrawer() {
const t = useTranslations("Cart");
@@ -251,9 +252,9 @@ export default function CartDrawer() {
</span>
</div>
{(checkout?.subtotalPrice?.gross?.amount || 0) < 5000 && (
{(checkout?.subtotalPrice?.gross?.amount || 0) < FREE_SHIPPING_THRESHOLD_RSD && (
<p className="text-xs text-[#666666] text-center">
{t("freeShippingOver", { amount: formatPrice(5000) })}
{t("freeShippingOver", { amount: formatPrice(FREE_SHIPPING_THRESHOLD_RSD) })}
</p>
)}
</div>
+2 -1
View File
@@ -1,10 +1,11 @@
"use client";
import { motion } from "framer-motion";
import { FREE_SHIPPING_THRESHOLD_RSD } from "@/lib/config/shipping";
export default function TickerBar() {
const items = [
"Free shipping on orders over 10000 RSD",
`Free shipping on orders over ${FREE_SHIPPING_THRESHOLD_RSD} RSD`,
"Natural ingredients",
"Cruelty-free",
"Handmade with love",