feat: Add quantity controls to cart with +/- buttons

This commit is contained in:
2026-03-07 17:57:31 -05:00
parent 339ac6727f
commit 2ba8004240
2 changed files with 71 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
:currency="currency"
@remove="removeFromCart"
@checkout="goToCheckout"
@update-quantity="updateCartQuantity"
/>
</div>
</v-col>
@@ -98,6 +99,16 @@ export default {
item.quantity = 0;
}
},
updateCartQuantity({ itemId, quantity }) {
const cartItem = this.cartItems.find(i => i.id === itemId);
if (cartItem) {
cartItem.quantity = quantity;
}
const productItem = this.items.find(i => i.id === itemId);
if (productItem) {
productItem.quantity = quantity;
}
},
goToCheckout() {
this.$router.push('/comprar');
},