MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / removeFromCart

Function removeFromCart

apps/testbed/src/App.tsx:88–97  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

86 }
87
88 function removeFromCart(id: string) {
89 const item = cart.find((i) => i.id === id);
90 if (item) {
91 op.track('remove_from_cart', {
92 product_id: item.id,
93 product_name: item.name,
94 });
95 }
96 setCart((prev) => prev.filter((i) => i.id !== id));
97 }
98
99 function startCheckout() {
100 const total = cart.reduce((sum, i) => sum + i.price * i.qty, 0);

Callers

nothing calls this directly

Calls 1

trackMethod · 0.45

Tested by

no test coverage detected