feat: add product to cart from main page
This commit is contained in:
parent
7516e0bc99
commit
e72f013d84
7 changed files with 14 additions and 53 deletions
|
|
@ -605,6 +605,7 @@ const market = async () => {
|
|||
},
|
||||
|
||||
addProductToCart(item) {
|
||||
console.log('### addProductToCart', item)
|
||||
let stallCart = this.shoppingCarts.find(s => s.id === item.stall_id)
|
||||
if (!stallCart) {
|
||||
stallCart = {
|
||||
|
|
@ -624,6 +625,11 @@ const market = async () => {
|
|||
product.orderedQuantity = Math.min(product.quantity, item.orderedQuantity || (product.orderedQuantity + 1))
|
||||
|
||||
this.$q.localStorage.set('nostrmarket.shoppingCarts', this.shoppingCarts)
|
||||
|
||||
this.$q.notify({
|
||||
type: 'positive',
|
||||
message: 'Product added to cart!'
|
||||
})
|
||||
},
|
||||
|
||||
removeProductFromCart(item) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue