The shopping cart is where customers review selected items, adjust quantities, enter delivery details, and place their order. The cart state is persisted entirely inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/ecommerce-delivery-frontend/llms.txt
Use this file to discover all available pages before exploring further.
localStorage — no server session is required to add items. When the user is ready to buy, all cart items and client details are submitted to the REST API in a single request, and a payment dialog guides the user through uploading a bank-transfer proof.
Route
/shoppingcar renders pages/shoppingCar/Car.vue, which imports DialogPaymentProcess for the post-order payment flow.
Cart storage
Products are saved tolocalStorage under the key productCar as a JSON array. Each item has the following shape:
ProductCard, the addToCart function either pushes a new entry or increments the cant field of an existing matching entry (same _id, same color, same size):
Managing quantities
Increment / decrement buttons
Each cart row has+ and − buttons that call increaseCant(index) and decreaseCant(index). Both functions update the reactive products array and sync back to localStorage:
Manual quantity input
Each row also contains a number input bound toprops.row.cant. Changes fire updateManualCant(index), which prevents negative values and recalculates the running total:
Removing items
removeProduct(rowIndex) splices the item from both the reactive array and localStorage, then fires the cartUpdated DOM event so other components (e.g. the cart badge in the header) can refresh their count:
Order total
The total is computed reactively by watching theproducts array:
Intl.NumberFormat for locale-aware formatting:
Checkout form fields
All fields are required and validated before the order is submitted. When a user is logged in, fields are pre-populated fromgetDataUser():
typeIdentification field is a select with four options:
Placing an order
Validate session
validateUser({ rol: 1 }) checks for a valid session token. If the user is not authenticated, the cart redirects to /login.Validate form fields
validateRequire(client, [...fields]) ensures every required field is filled. A Quasar notification is shown if any field is missing.Validate minimum quantity
The cart checks that every product has
cant >= 1. Orders with zero-quantity items are blocked.Submit order
A
POST /api/sale/pay/:productId request is sent with the payload below and an Authorization: Bearer <token> header.Request payload
Payment dialog
After a successful order,DialogPaymentProcess opens. It displays Bancolombia bank-transfer instructions (account holder, account number, account type) and embeds the ConfimPayment component, which lets the user upload their payment proof image:
/shoppingList to monitor their order status.
The cart is ephemeral. Cart contents live only in
localStorage. Clearing browser storage or opening the app in a different browser or device will result in an empty cart. Complete your order before closing the tab to avoid losing your selection.