diff --git a/app/components/Cart/CartFAB.vue b/app/components/Cart/CartFAB.vue new file mode 100644 index 0000000..dcd5d48 --- /dev/null +++ b/app/components/Cart/CartFAB.vue @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + {{ itemCount > 99 ? '99+' : itemCount }} + + + + + + + + {{ formattedTotal }} + + + + + diff --git a/app/components/navigation/CartButton.vue b/app/components/navigation/CartButton.vue index 2fdd178..7ba3622 100644 --- a/app/components/navigation/CartButton.vue +++ b/app/components/navigation/CartButton.vue @@ -2,42 +2,65 @@ import { ShoppingCart } from 'lucide-vue-next' import { Badge } from '@/components/ui/badge' -// TODO: This will come from cart store/composable in Phase 5 -const cartItemCount = ref(0) +const { itemCount, total } = useCart() +const { open } = useCartUI() -const hasItems = computed(() => cartItemCount.value > 0) +const hasItems = computed(() => itemCount.value > 0) + +// Format total price in German locale (EUR) +const formattedTotal = computed(() => { + return new Intl.NumberFormat('de-DE', { + style: 'currency', + currency: 'EUR', + }).format(total.value) +}) + +// Handle button click to open cart sidebar +function handleClick(e: Event) { + e.preventDefault() + open() +} - + - - - - - + + + + + - {{ cartItemCount > 99 ? '99+' : cartItemCount }} - - + + {{ itemCount > 99 ? '99+' : itemCount }} + + + + + + + {{ formattedTotal }} + - + - +
+ {{ formattedTotal }} +