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:
@@ -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>
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user