Welcome to the comprehensive API documentation for the Webasyst framework, Shop-Script, and related components. This documentation provides detailed information about all public APIs, functions, components, and best practices for developing with the Webasyst ecosystem.
This documentation set covers:
- Webasyst Framework Core APIs - Complete framework functionality
- Shop-Script E-commerce APIs - Online store development
- Hypermarket Theme APIs - Professional e-commerce theme
- Plugin Development - Extending functionality
- Theme Development - Custom design creation
- Best Practices - Development guidelines and examples
Complete guide to the core Webasyst framework
Covers:
- Core Framework Classes (
waSystem,waConfig,waRequest,waResponse) - Controller Classes (
waController,waViewController,waJsonController) - Model Classes (
waModel,waContactModel) - View and Template System (
waSmarty, template functions) - Plugin System (
waPlugin, event handlers) - Theme System (theme structure, configuration)
- Event System (
waEvent, event handling) - Authentication & Authorization (
waUser,waAuth) - Database Layer (
waDbAdapter, query building) - Utility Classes (
waUtils,waFiles) - REST API (endpoints, authentication)
- Site App Specific APIs (routing, pages, domains)
- Examples & Best Practices
Complete guide to e-commerce development
Covers:
- Product Management APIs (
shopProductModel, SKUs, inventory) - Order Management APIs (
shopOrderModel, order lifecycle) - Customer Management APIs (
shopCustomerModel, addresses) - Payment & Shipping APIs (plugin development)
- Hypermarket Theme APIs (responsive design, template functions)
- Shopping Cart APIs (
shopCartModel, AJAX cart) - Catalog & Category APIs (
shopCategoryModel, filtering) - Plugin Development (Shop-Script specific)
- Frontend Templates (product pages, category pages)
- Mobile & Responsive Features
- SEO & Marketing APIs (structured data, analytics)
- Web Server: Apache, nginx, or IIS
- PHP: 7.4+
- PHP Extensions: spl, mbstring, iconv, json, gd or ImageMagick
- Database: MySQL 4.1+
# Clone the framework
git clone https://github.com/webasyst/webasyst-framework.git
# Set permissions
chmod 0775 /path/to/webasyst
# Run web installer
# Navigate to http://your-domain/webasyst/ in browser// Get system instance
$wa = waSystem::getInstance();
// Get current user
$user = $wa->getUser();
if ($user->isAuth()) {
echo "Welcome, " . $user->getName();
}
// Handle request
$request = waRequest::getInstance();
$page = $request->get('page', 1, 'int');class myappIndexAction extends waViewAction
{
public function execute()
{
$this->view->assign('title', 'My App');
$this->view->assign('message', 'Hello, Webasyst!');
}
}class myappProductModel extends waModel
{
protected $table = 'myapp_product';
public function getActive()
{
return $this->select('*')
->where('status = ?', 'active')
->fetchAll();
}
}- Framework Repository: https://github.com/webasyst/webasyst-framework
- Shop-Script Repository: https://github.com/webasyst/shop-script
- Hypermarket Theme: https://github.com/webasyst/hypermarket-theme
- Developer Portal: https://developers.webasyst.com/
- Documentation: https://developers.webasyst.com/docs/
- Site - Website management and routing
- Shop-Script - E-commerce platform
- CRM - Customer relationship management
- Mailer - Email marketing
- Blog - Content management
- Photos - Image galleries
- Hub - Knowledge base and discussions
wa-apps/ # Application modules
wa-config/ # Configuration files
wa-content/ # User content and uploads
wa-installer/ # Installation scripts
wa-plugins/ # Plugin modules
wa-system/ # Core framework files
wa-widgets/ # Dashboard widgets
For building online stores, focus on:
For building custom apps, start with:
For creating custom themes:
For extending functionality:
waSystem- Main system classwaController- Base controllerwaModel- Database operationswaUser- User managementwaRequest- HTTP requestswaResponse- HTTP responses
shopProductModel- Product managementshopOrderModel- Order processingshopCartModel- Shopping cartshopCategoryModel- Category management
{wa_url}- URL generation{shopProductUrl}- Product URLs{shopProductImage}- Product images{shopProductPrice}- Price formatting
See the complete example in Examples & Best Practices
Follow the Shop-Script Overview
Check out Hypermarket Theme APIs
Review Plugin Development section
Always follow these security guidelines:
// Validate input
$email = $request->post('email', '', 'string');
if (!wa()->getValidator('email')->isValid($email)) {
throw new waException('Invalid email');
}
// Check user rights
if (!wa()->getUser()->getRights('myapp', 'edit')) {
throw new waRightsException('Access denied');
}
// Use prepared statements
$items = $model->select('*')->where('user_id = ?', $user_id)->fetchAll();Enable debugging and logging:
// Application logs
waLog::log('User action performed', 'myapp/user.log');
// Error logs
waLog::log($exception->getMessage(), 'myapp/error.log');
// Debug logs (only in debug mode)
waLog::debug($debug_data, 'myapp/debug.log');Support multiple languages:
// In PHP code
$message = _w('Item saved successfully');
// In templates
{"Item saved successfully"|_w}
// With parameters
{sprintf(_w('Found %d items'), $count)}For modern development workflows:
{
"require": {
"webasyst/framework": "^3.7"
}
}To contribute to this documentation:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This documentation is provided under the same license as the Webasyst framework (LGPL-3.0).
- Documentation Issues: Submit an issue to this repository
- Framework Support: https://support.webasyst.com/
- Developer Forums: https://support.webasyst.com/
- Commercial Support: support@webasyst.com
Last Updated: January 2025
Framework Version: 3.7.0+
Shop-Script Version: 8.0+
For the most up-to-date information, always refer to the official Webasyst developer documentation at https://developers.webasyst.com/docs/