update fastfood,

This commit is contained in:
louiscklaw
2025-06-06 12:55:43 +08:00
parent 5234ac06cd
commit 7cfbcc1573
19 changed files with 1367 additions and 13 deletions

View File

@@ -0,0 +1,17 @@
import { Store } from "pullstate";
export const CartStore = new Store({
total: 0,
product_ids: []
});
export const addToCart = (categorySlug, productID) => {
CartStore.update(s => { s.product_ids = [ ...s.product_ids, `${ categorySlug }/${ parseInt(productID) }` ]; });
}
export const removeFromCart = productIndex => {
CartStore.update(s => { s.product_ids.splice(productIndex, 1) });
}