Skip to content

pro-wow/webasyst-api-docs

Repository files navigation

Webasyst Framework Complete API Documentation

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.

πŸ“š Documentation Overview

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

πŸ“– Documentation Files

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)

πŸš€ Quick Start Guide

System Requirements

  • Web Server: Apache, nginx, or IIS
  • PHP: 7.4+
  • PHP Extensions: spl, mbstring, iconv, json, gd or ImageMagick
  • Database: MySQL 4.1+

Installation

# 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

Basic Usage Examples

Getting Started with Framework

// 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');

Creating a Simple Controller

class myappIndexAction extends waViewAction
{
    public function execute()
    {
        $this->view->assign('title', 'My App');
        $this->view->assign('message', 'Hello, Webasyst!');
    }
}

Working with Models

class myappProductModel extends waModel
{
    protected $table = 'myapp_product';
    
    public function getActive()
    {
        return $this->select('*')
            ->where('status = ?', 'active')
            ->fetchAll();
    }
}

πŸ›  Development Resources

Official Links

Key Components

Core Applications

  • 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

Framework Architecture

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

🎯 Common Use Cases

E-commerce Store Development

For building online stores, focus on:

Custom Application Development

For building custom apps, start with:

Theme Development

For creating custom themes:

Plugin Development

For extending functionality:

πŸ”§ API Reference Quick Links

Framework Core

Shop-Script Core

Template Functions

πŸ“ Examples and Tutorials

Creating a Simple App

See the complete example in Examples & Best Practices

E-commerce Store Setup

Follow the Shop-Script Overview

Theme Customization

Check out Hypermarket Theme APIs

Plugin Development

Review Plugin Development section

πŸ›‘ Security Best Practices

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();

πŸ” Debugging and Logging

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');

🌐 Internationalization

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)}

πŸ“¦ Package Management

For modern development workflows:

{
    "require": {
        "webasyst/framework": "^3.7"
    }
}

🀝 Contributing

To contribute to this documentation:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

This documentation is provided under the same license as the Webasyst framework (LGPL-3.0).

πŸ†˜ Support


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/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •