feat: show total cart item count
This commit is contained in:
parent
2b0664b613
commit
e1b2a4a479
2 changed files with 13 additions and 5 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue