Overview
The inventory management system provides a comprehensive view of all products in your store. Browse through your entire catalog with advanced search and sorting capabilities, and manage products with full CRUD operations.The inventory automatically displays real-time stock levels that are updated through the Stock Movements module.
Main Inventory View
The main inventory page (index.php) displays all products in a sortable, searchable table:
Dynamic Sorting
Click any column header to sort by ID, name, price, stock, category, size, or color
Multi-field Search
Search across product names, categories, colors, sizes, prices, and IDs simultaneously
Real-time Stock
View current stock levels with automatic updates from stock movements
Quick Actions
Edit or delete products directly from the inventory table
Database Query
The inventory view pulls data from multiple related tables:Search Implementation
The search feature queries multiple fields simultaneously:The search supports both partial matches (using LIKE) and exact ID lookups for precise filtering.
Sortable Columns
The inventory table supports sorting by the following columns:| Column | Database Field | Sort Type |
|---|---|---|
| ID | p.id_prenda | Numeric |
| Nombre | p.nombre | Alphabetic |
| Precio | p.precio | Numeric |
| Stock | p.stock_actual | Numeric |
| Categoría | c.nombre | Alphabetic |
| Talla | t.talla | Alphabetic |
| Color | col.nombre | Alphabetic |
Column Configuration
Allowed sortable columns are defined in a whitelist:Sort Direction Toggle
The header link function maintains both search and sort state:Search & Filter Workflow
Enter Search Term
Type a search query in the search box (e.g., “Camisa”, “Azul”, “M”, or a specific price)
View Results
The table displays all matching products. If no results are found, a friendly message appears.
Product Data Structure
Each product (prenda) contains the following fields:- Product Fields
- Foreign Keys
- id_prenda: Unique product identifier (auto-increment)
- nombre: Product name (e.g., “Camisa Oxford Slim”)
- precio: Current price in decimal format (10,2)
- stock_actual: Real-time inventory count
Quick Actions
Each product row includes action buttons:Edit Button
Delete Button
Empty State
When no products match the search criteria:Related Features
Catalog Management
Manage categories, colors, and sizes used in inventory
Stock Movements
Track entries, exits, and adjustments that affect stock levels
Price Updates
View historical price changes for products