diff --git a/static/js/market.js b/static/js/market.js index 321b757..2bc1d46 100644 --- a/static/js/market.js +++ b/static/js/market.js @@ -124,6 +124,10 @@ const market = async () => { }, canEditConfig() { return this.account && this.account.pubkey == this.config?.pubkey + }, + + allCartsItemCount() { + return this.shoppingCarts.map(s => s.products).flat().reduce((t, p) => t + p.orderedQuantity, 0) } }, async created() { @@ -567,8 +571,6 @@ const market = async () => { }, addProductToCart(item) { - console.log('### addProductToCart:', item) - let stallCart = this.shoppingCarts.find(s => s.id === item.stall_id) if (!stallCart) { stallCart = { diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index fa52787..d3b8d33 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -181,10 +181,16 @@ User Config - Shopping - Cart + + Shopping Cart + + + + + +