Overview
The inventory management system in Yoneily is built around product galleries that support images, pricing, stock levels, and categorization. Each product is represented as a gallery item with comprehensive tracking capabilities.Product Gallery Structure
Gallery Fields
| Field | Type | Description |
|---|---|---|
id_galeria | int | Unique product identifier |
texto_galeria | varchar(255) | Product name/title |
descripcion | text | Detailed product description |
thumbnails | text | Main product image filename |
url | varchar(255) | SEO-friendly URL slug |
claves | varchar(255) | Keywords/tags for search |
publicar | int | Publication status (0=hidden, 1=published) |
precio | double | Product price |
garantia | varchar(255) | Warranty information |
cantidad | int | Total quantity received |
cantidad_existente | int | Current stock level |
cantidad_alerta | int | Low stock alert threshold |
prod_vendidos | int | Total units sold |
locale_id_local | int | Store/vendor association |
usuario_id_usuario | int | User who created the product |
fechacre_galeria | timestamp | Creation date |
excluir | tinyint | Exclude from listings |
Product Management Workflows
Adding Products
Enter Product Details
Fill in the required information:
- Product Name (
texto_galeria) - required - Description - required
- Keywords (
claves) - required for SEO - Price - product cost
- Warranty - warranty terms
Upload Product Image
Select a product image (thumbnails field):Supported formats: JPG, JPEG, PNG, GIFProcessing:
- Original stored in
/files/galeria/otras/ - Thumbnail (124x124) generated in
/files/galeria/thumbnails/ - Display version (600x480) in
/files/galeria/normal/
Set Stock Levels
Define inventory quantities:
- Initial Quantity (
cantidad) - total received - Alert Threshold (
cantidad_alerta) - low stock warning - System automatically sets
cantidad_existente=cantidad - System initializes
prod_vendidos= 0
Image Processing
Yoneily automatically generates multiple image sizes for optimal display:URL Generation
Products automatically generate SEO-friendly URLs: Formula:texto_galeria + claves (slugified and deduplicated)
Example:
- Product Name: “Mesa de Madera”
- Keywords: “artesanal roble”
- Generated URL:
mesa-de-madera-artesanal-roble - If duplicate:
mesa-de-madera-artesanal-roble_1
URLs are automatically generated in the
beforeSave() model method, ensuring uniqueness across the system.Stock Management
Stock Tracking Fields
- cantidad
- cantidad_existente
- cantidad_alerta
- prod_vendidos
Total Quantity ReceivedThe original inventory count when the product was added or restocked.
Stock Updates on Sale
When a product is sold, the system automatically:- Validates stock availability (
cantidad_existente > 0) - Decrements inventory:
- Increments sold counter:
- Updates database via
Gallery->updateAll()
Product Editing
Edit Workflow
- Navigate to Galleries > Index
- Select product to edit
- Modify fields:
- Product information
- Description and keywords
- Price and warranty
- Stock quantities (resets
cantidad_existenteto newcantidad)
- Upload new image (optional)
- New image replaces old thumbnail/normal versions
- Original is preserved in
/otras/directory
- Save changes
Product Visibility
Publication Status
Control product visibility with thepublicar field:
Activate Product
Route:
/galleries/activa/{id}Sets publicar = 1 to make product visible to customersDeactivate Product
Route:
/galleries/desactiva/{id}Sets publicar = 0 to hide product from public view- Out of stock items (temporarily)
- Seasonal products
- Products under review
- Testing new listings
Categories
Category Structure
Products can be organized using hierarchical categories:| Field | Description |
|---|---|
id_categorias | Category ID |
nombre_categorias | Category name |
categorias_id_categorias | Parent category (for subcategories) |
usuario_id_usuario | User who created category |
Category Relationships
Categories use a hasAndBelongsToMany (HABTM) relationship with products:- Join table:
categories_galleries - Products can belong to multiple categories
- Categories can contain multiple products
Multiple Images
File Attachments
Products support multiple images through the file attachment system: Join Table:archivos_galleries
Fields:
files_id_file- Reference to file inarchivostablegalerias_id_galeria- Reference to product
- Images: JPG, JPEG, PNG, GIF
- Audio: MP3
- Flash: SWF, FLV
Deleting Images
Delete Route:/galleries/deleteimg/{gallery_id}/{file_id}
Store/Vendor Filtering
Vendor View
When vendors log in, they see only their own products:- Data isolation between vendors
- Simplified inventory view
- Faster query performance
Administrator View
Administrators see products from all stores with no filtering applied.Product Listing
Pagination
Products are displayed with pagination: Settings:- 10 products per page
- Ordered by
fechacre_galeria DESC(newest first) - Includes related data:
- User information
- Store/locale details
- Categories
- Attached files
Store Lookup (AJAX)
The system provides an autocomplete store search: Endpoint:/galleries/verlocal
Parameters: term (search query)
Returns: JSON array of matching stores
Product Deletion
Delete Workflow
Cascade Delete
System removes:
- Product record from
galleriestable - Associated category links
- File attachments (metadata, not physical files)
Search & Filtering
Product Discovery
Products can be found through:- Category Browse - Navigate category hierarchy
- Keyword Search - Search using
clavesfield - Store Filter - View products by vendor
- URL Direct Access - SEO-friendly URLs
Keywords (claves)
Keywords improve product discoverability:
Best Practices:
- Use descriptive terms
- Include material types
- Add color variations
- Specify product categories
- Include brand names (if applicable)
Related Features
Sales Tracking
View product sales and revenue
Galleries
Manage multimedia content
User Management
Vendor access control
Technical Details
Model Relationships
Image Upload Behavior
The Gallery model uses MeioUpload behavior:Validation Rules
texto_galeria (Product Name)
texto_galeria (Product Name)
- Required field (notEmpty)
- Used in URL generation
- No maximum length enforced
descripcion (Description)
descripcion (Description)
- Required field (notEmpty)
- Text field for detailed information
claves (Keywords)
claves (Keywords)
- Required field (notEmpty)
- Used in URL generation and search
locale_id_local (Store)
locale_id_local (Store)
- Required field (notEmpty)
- Must reference existing locale