Overview
PixelTech’s shopping cart provides a seamless purchase experience with real-time inventory monitoring, automatic price updates, and flexible checkout options including multiple payment methods and shipping configurations.Shopping Cart Experience
Adding Products to Cart
Cart Features
Live Stock Monitoring
Firebase connection tracks inventory in real-time
Automatic Price Updates
If product price changes, cart reflects new price
Variant Tracking
Each color/capacity combination tracked separately
Quantity Management
Increment/decrement with stock limit validation
How Real-Time Cart Sync Works
Intelligent Monitoring
The cart doesn’t just store static data - it actively watches Firebase:What Gets Updated Automatically
- Price Changes
- Stock Adjustments
- Product Deactivation
- Variant Changes
When Admin Updates Price
- Firebase detects the change
- Cart receives update via onSnapshot
- Item price updates silently in cart
- Cart total recalculates automatically
- Customer sees new price on cart page
Cart items added before a price increase keep their original price until the customer refreshes or leaves the page.
Smart Cleanup
When customer removes items from cart:- Real-time listener for that product is immediately stopped
- Reduces Firebase connection usage
- Optimizes performance and costs
Cart Page Features
Cart Display
Each cart item shows:- Product image (from selected color variant if applicable)
- Product name with full specifications
- Selected variant (color and/or capacity badges)
- Unit price (current price from Firebase)
- Quantity controls (with +/- buttons)
- Line total (price × quantity)
- Remove button (instant deletion)
- Discount indicators (if original price was higher)
Quick Actions
Quantity Adjustment
- Click + to add one more unit (validates against stock)
- Click - to remove one unit
- If quantity reaches 0, item is removed from cart
- System prevents exceeding available stock
Item Removal
- Instant removal with confirmation
- Cart total recalculates immediately
- Cart badge updates in header
- Empty cart shows “Continue Shopping” message
Cart Summary
Checkout Process
Checkout Page Flow
Authentication Check
Customer must be logged in. Guests are redirected to login page with redirect back to checkout.
Load Saved Data
System loads customer profile, saved addresses, and order history using real-time sync.
Shipping Information
Address Management
- New Customers
- Returning Customers
- Profile Auto-Complete
First Checkout
- Enter full shipping details manually
- Address is automatically saved as default
- Creates foundation for future orders
Location Selection
Department & City Autocomplete Integration with Colombia API for accurate locations:- Customer types department name (e.g., “Cundinamarca”)
- System shows matching departments
- Customer selects department
- Cities load for that department
- Customer types and selects city (e.g., “Bogotá”)
Shipping Cost Calculation
How Shipping is Calculated
- Free Shipping
- City-Based Pricing
- Default Rate
Order Value ThresholdWhen cart value exceeds the threshold (configured by admin), shipping is free nationwide.
Real-Time Shipping Config Sync
Shipping configuration loads from Firebase with real-time monitoring:- Initial Load: From sessionStorage cache (instant)
- Background Sync: onSnapshot listens for admin changes
- Automatic Update: If admin changes shipping rates, customer sees new rates immediately
- No Page Reload: Updates happen silently in background
Dispatch Time Indicator
Dynamic messaging based on cutoff time:- Before Cutoff
- After Cutoff
Same-Day Dispatch AvailableShows countdown to cutoff time (e.g., 2:00 PM). Creates urgency for same-day dispatch.
Payment Methods
Available Payment Options
MercadoPago
Online Payment Gateway
- Credit/debit cards
- Nequi
- PSE (bank transfer)
- Bancolombia
- Available nationwide
Cash on Delivery (COD)
Pay When Receiving
- Pay driver with cash/card
- Only available in Bogotá
- Automatically disabled for other cities
ADDI
Buy Now, Pay Later
- Instant credit approval
- Flexible installments
- Requires valid ID and phone
- Available nationwide
Sistecrédito
Credit Financing
- Consumer credit platform
- Multiple payment plans
- Requires valid ID and phone
- Available nationwide
Payment Method Validation
Location-Based RestrictionsPayment Processing Flow
- MercadoPago
- Cash on Delivery
- ADDI
- Sistecrédito
Online Gateway Flow
- Customer clicks “Pay with MercadoPago”
- System validates all form data
- Auto-saves address if first-time customer
- Calls Firebase Function
createMercadoPagoPreference - Function creates payment session in MercadoPago
- Customer redirected to MercadoPago checkout
- Customer completes payment
- MercadoPago webhook notifies backend
- Backend creates order in Firebase
- Customer redirected to success page
Submit Button States
Button text changes based on selected payment method:Invoice Options
Requesting an Invoice
Enter Tax Information
- Business name
- Tax ID (NIT/RUT)
- Billing address
- Billing city
- Email for invoice delivery
- Phone number
Invoice request is optional. Most customers order without requesting formal invoices.
Smart Profile Auto-Save
Automatic Profile Completion
The checkout process intelligently updates customer profiles: First-Time BuyersThis ensures customer profiles are always complete without requiring separate profile setup steps.
Order Summary Display
Checkout Summary Panel
cartUpdated event listener).
Related Features
Product Catalog
How customers discover and browse products
User Accounts
Profile and saved address management
Order Tracking
What happens after checkout