eComTall / Livewire commerce study / 2024
Making catalogue filters shareable with Livewire.
eComTall gives a filtered product search its own URL and carries cart selections between pages through a shared cookie helper.
- ROLE
- Laravel and Livewire implementation / coursework
- STATE OF THE BUILD
- Study
- RECORD UPDATED
THE WORK
The project.
A product search in eComTall can be reopened with its category, brand, price and sort choices intact. Livewire stores those selections in the URL and applies them to the server's Eloquent query. The coursework also connects product pages to a shared cart helper: it saves item quantities and captured prices in a cookie, then tells the navigation to refresh its count. Browsing and cart state are implemented; checkout remains a shell.
IMPLEMENTATION
Design choices.
- URL properties make the same filtered search available after navigation or through a shared link. They carry selections, not a precomputed copy of the results.
- The cart cookie lasts thirty days and doesn't need an account-owned cart table. Its saved price is a snapshot, though, not an authoritative price for a future order.
- Cart changes stay in one helper, with an event used for the navigation update. That keeps the displayed count connected to the operation without duplicating cart logic.
HOW IT FITS TOGETHER
Architecture.
- ProductsPage builds its query from Livewire URL properties, adds the selected conditions and returns a paginated result. The address describes the search while Laravel still selects the products.
- CartManagement reads the existing JSON cookie, adds or updates the product entry and queues the revised cookie. Product IDs, quantities and captured unit prices travel together instead of being held by individual page components.
- After adding an item, the product component dispatches update-cart-count to the navigation. The navigation displays the new count without taking over the operation that changes the cart.
MADE WITH
PHP · Laravel 11 · Livewire 3 · Filament 3 · Blade · Tailwind CSS
CHECKS & RESULTS
What was checked.
A source review shows what the code does. It is not a fresh test of the running app.
Code and development records reviewedReviewed
The code, tests and available development records were checked. Reported test results keep their original scope. No fresh app or live deployment check was run for this write-up.
- Scope of this check
- Code review, not a fresh run of the app
NEXT
Still to work through.
The next stage is order handling, not just a checkout button. A real checkout would need to reload prices, check stock and handle payment. The current cookie cart doesn't establish any of those outcomes.