CoreCommerce - a fast, secure, and flexible e-commerce platform built on pure PHP and MySQL, designed as a lightweight alternative to bulky CMS systems.
🔗 Live Demo: CoreCommerce
CoreCommerce is a full-featured online store platform built on a custom minimalist PHP framework. It provides maximum security and flexibility out of the box, with modular architecture for easy customization and extension.
- Custom MVC Framework: Built-in routing, controllers, models, and views
- Database Layer: PDO-based with Active Record pattern
- Security: CSRF protection, session management, password hashing, rate limiting
- Plugin System: Extensible architecture for adding functionality
- Theme System: Multiple built-in themes (default, modern, premium) with easy switching
- Product Management: Full CRUD with categories, attributes, images, and inventory
- Advanced Filtering: 3-step pipeline for category product filtering with range and multi-select support
- Shopping Cart: Session-based cart with quantity management
- Order Processing: Complete order workflow from checkout to fulfillment
- Payment Integration: Support for multiple payment gateways (LiqPay, Prom API)
- Shipping: Logistics lookup and shipping method management
- SEO Optimization: Automatic meta tags, sitemaps, and robots.txt generation
- Product Reviews: Customer review system with moderation
- Social Media: Social login integration and social link management
- Email Marketing: Built-in email templates and notification system
- Dashboard: System status, cache management, and quick statistics
- Product Management: Bulk operations, attribute management, image handling
- Order Management: Order processing, status updates, customer communication
- User Management: Role-based access control, customer accounts
- Content Management: Pages, banners, and static content
- System Settings: Configuration management for all platform features
- Currency Management: Multi-currency support with automatic exchange rate updates
- Search Service: Full-text product search with relevance ranking
- Sitemap Generation: Automatic XML sitemap creation for search engines
- Prom Integration: Two-way sync with Prom.ua marketplace
- Stock Management: Local and remote stock tracking with alerts
- Image Management: Automatic image optimization and thumbnail generation
├── app/
│ ├── Controllers/ # Request handlers (30+ controllers)
│ ├── Core/ # Framework core components
│ │ ├── Database/ # Database abstraction layer
│ │ ├── Routing/ # URL routing system
│ │ ├── Payment/ # Payment gateway integrations
│ │ ├── Plugin/ # Plugin management system
│ │ ├── Theme/ # Theme loading and rendering
│ │ └── ...
│ ├── Middleware/ # HTTP middleware (auth, etc.)
│ ├── Models/ # Data models (14 models)
│ └── Services/ # Business logic services (16 services)
├── config/ # Configuration files
├── lang/ # Translation files (en, pl, ua)
├── plugins/ # Plugin system
├── public/ # Web root directory
├── resources/
│ ├── themes/ # Theme templates (3 themes)
│ └── views/ # View templates
├── routes/ # Route definitions
├── storage/ # Cache, logs, uploads
└── migrations/ # Database migrations
Routing System
- Custom router (
app/Core/Routing/Router.php) - Route definitions in
routes/web.php - Support for GET/POST requests and URL parameters
- RESTful route patterns
Database Layer
- PDO wrapper (
app/Core/Database/DB.php) - Active Record base model (
app/Core/Model.php) - Migration system for schema versioning
- Support for MySQL 8.0+
Localization
- Multi-language support (English, Polish, Ukrainian)
- Easy language addition via configuration
- Language files in
lang/directory - URL-based language switching (
/language/{lang})
Theme System
- Three built-in themes: default, modern, premium
- Theme selection via
config/theme.php - Template inheritance and layouts
- Asset versioning for cache busting
Plugin System
- Plugin manager (
app/Core/Plugin/PluginManager.php) - Plugin loading from
plugins/directory - Hook system for extending functionality
- Built-in plugins: CallbackWidget, LiqPayGateway, TestPlugin
Security
- CSRF protection on all forms
- Session regeneration and management
- Password hashing with bcrypt
- Login rate limiting
- Security headers service
- Input validation and sanitization
The platform includes 16 specialized services for business logic:
- ProductFilterService: Advanced category filtering with range and multi-select support
- SearchService: Full-text product search with relevance ranking
- SeoService: SEO optimization and meta tag generation
- SitemapService: Automatic XML sitemap generation
- SecurityHeadersService: HTTP security headers management
- ImageManager: Image optimization and thumbnail generation
- BankCurrencyService: Currency exchange rate updates
- LocalStockService: Local inventory management
- PromApiClient: Prom.ua API integration
- PromSyncService: Two-way marketplace synchronization
- PromStatusService: Order status synchronization
- SlugHelper: URL slug generation and management
- StockServiceFactory: Stock management service factory
- LoginRateLimiter: Login attempt rate limiting
The platform supports multiple payment gateways through the payment system:
- LiqPay: Ukrainian payment gateway with webhooks
- Prom API: Integration with Prom.ua marketplace payments
- Extensible Architecture: Easy addition of new payment gateways
- PHP: >= 8.3
- MySQL: 8.0 or higher
- Composer: For dependency management
- Web Server: Apache with mod_rewrite or Nginx
- PHP Extensions: PDO, PDO_MySQL, GD, cURL, JSON, MBString
-
Clone or download the project
git clone <repository-url> cd mysite.test
-
Install dependencies
composer install composer require phpmailer/phpmailer
-
Configure environment
- Copy
.env.exampleto.env - Edit
.envwith your database credentials - Configure
config/database.phpwith database settings
- Copy
-
Configure mail settings
- Edit
config/mail.phpwith your SMTP details - Set up email templates for notifications
- Edit
-
Set up database
- Import the database schema from
ec30.sql - Run migrations if available
- Configure database connection in
config/database.php
- Import the database schema from
-
Set permissions
chmod -R 755 storage/ chmod -R 755 public/uploads/
-
Configure web server
- Point document root to
public/directory - Ensure mod_rewrite is enabled (Apache)
- Configure URL rewriting rules
- Point document root to
Apache (.htaccess included)
- Document root:
public/ - mod_rewrite enabled
- Follow symbolic links
Nginx
server {
listen 80;
server_name your-domain.com;
root /path/to/mysite.test/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}The admin panel provides comprehensive management capabilities:
- Dashboard: System status, quick statistics, and cache management
- Products: Full product management with attributes, images, and inventory
- Categories: Category hierarchy and organization
- Orders: Order processing, status management, and customer communication
- Users: User management with role-based access control
- Content: Pages, banners, and static content management
- Attributes: Product attribute definitions and options
- Reviews: Customer review moderation
- Plugins: Plugin management and configuration
- Themes: Theme selection and customization
- Prom Integration: Prom.ua marketplace synchronization
- System Settings: Platform configuration and preferences
In the admin dashboard (Панель керування → Стан системи) there is a "Почистити кеш" button.
Features:
- CSRF-protected POST request
- Clears cache files from
storage/cache/*(includingactive_plugins.json) - Updates
settings.asset_versionfor CSS/JS cache busting - Safe operation that preserves essential system files
Category product filtering uses a strict 3-step pipeline in App\Services\ProductFilterService:
-
Normalization Layer (
normalizeFilters)- Converts raw URL/controller filters into deterministic DTO-like arrays
- Supports
match(withoption_ids/values) andrange(withmin/max) - Validates and sanitizes filter inputs
-
SQL Predicate Builder (
buildBaseProductQuery)- Creates safe prepared-statement conditions
- Uses isolated
EXISTSsubqueries per attribute - Avoids JOIN explosion and duplicate products
- Ensures SQL injection protection
-
Filter Options Provider (
getFilterOptions)- Builds selectable options with canonical
opt:{attribute_option_id}values - Legacy
valuefallback for historic plain-text rows - Dynamic option availability based on current results
- Builds selectable options with canonical
- Selectable attributes are matched by
product_attributes.attribute_option_id(canonical path) - Legacy compatibility fallback preserved by matching
product_attributes.valuefor old text-only data - Numeric ranges use
CAST(pa.value AS DECIMAL(12,2))with numeric guard regex - Multi-select for one attribute works as OR inside one attribute predicate
- Multi-attribute filtering works as AND via separate
EXISTSconditions
This architecture maintains existing DB schema and URL format (attr_{id}, attr_{id}_min, attr_{id}_max) while removing legacy runtime branches based on JOIN alias chains.
The platform supports multiple languages with an easy addition process:
Adding a new language requires exactly two steps:
-
Add a line to
config/languages.php:'pl' => 'Polski'
-
Create language files:
lang/pl.php- Core translation filelang/pl.json- Plugin translations (if needed)
Automatic integration:
- The
/language/{lang}route automatically handles language switching - Settings dropdown in admin panel automatically includes new languages
- Theme switchers in 'modern' and 'premium' themes automatically pick up the list
- No code editing required for language addition
Currently supported languages:
- English (en)
- Polish (pl)
- Ukrainian (ua)
Prom.ua Integration
- Two-way product synchronization
- Automatic stock level updates
- Order status synchronization
- Webhook handling for real-time updates
- Bulk operations for efficiency
Features:
- Product catalog sync with attribute mapping
- Inventory management across platforms
- Order processing automation
- Status tracking and updates
- Error handling and retry mechanisms
- CSRF Protection: All forms protected with CSRF tokens
- Session Management: Secure session handling with regeneration
- Password Security: Bcrypt hashing for user passwords
- Rate Limiting: Login attempt rate limiting to prevent brute force
- Input Validation: Comprehensive input sanitization and validation
- SQL Injection Prevention: Prepared statements for all database queries
- XSS Protection: Output escaping and content security policies
- Security Headers: HTTP security headers via SecurityHeadersService
Security settings can be configured in config/security.php:
- Session timeout settings
- Password requirements
- Rate limiting thresholds
- Allowed file types for uploads
- Security header configuration
- View caching for improved rendering performance
- Asset versioning for browser cache control
- Query optimization with proper indexing
- Image optimization and thumbnail generation
- Database query caching where appropriate
- Proper indexing on frequently queried columns
- Optimized queries with EXISTS instead of JOINs where beneficial
- Connection pooling via PDO
- Migration system for schema updates
Controllers
- Create in
app/Controllers/ - Extend base controller functionality
- Follow naming convention:
FeatureController.php
Models
- Create in
app/Models/ - Extend
app/Core/Model.php - Define table name and relationships
Services
- Create in
app/Services/ - Implement business logic
- Keep controllers thin
Routes
- Add to
routes/web.php - Follow RESTful conventions
- Group related routes
The project structure supports testing with appropriate test directories and fixtures.
Additional documentation is available:
INSTALL_EN.md- Detailed English installation guideINSTALL_UA.md- Detailed Ukrainian installation guidedocs/directory - Additional documentation and guides
This project is distributed under the MIT License. See the LICENSE file for details.
For support, issues, or contributions, please refer to the project repository or contact the development team.
- Additional payment gateway integrations (Stripe, PayPal)
- RESTful API for mobile app integration
- Advanced analytics dashboard
- Multi-vendor marketplace support
- AI-powered product recommendations
- Advanced marketing tools (coupons, email campaigns)
- Mobile app companion
- Advanced inventory management
- Enhanced reporting and analytics
CoreCommerce is an independent, community-driven open-source project. It is not affiliated, sponsored, or legally related to any commercial companies or third-party products using the "CoreCommerce" brand name.