Skip to content

Module developer's tutorial

beatnbite edited this page Oct 2, 2012 · 29 revisions

Module Developer's Tutorial

Introduction

LiteCommerce is an e-commerce solution written in PHP utilizing version 5.3's object-oriented feature set which allows a modular architecture. In order to keep future updates and upgrades easy and simple, all changes to e-commerce websites built with LiteCommerce should be made as modules. Functions and design should never be modified by directly editing LiteCommerce's core files or its modules. Even a bug-fixing patch should be distributed as a module until the bug is fixed in a newer LiteCommerce version.

A LiteCommerce module is a collection of files that includes:

  • PHP scripts, extending or replacing the default functionality of LiteCommerce.
  • Template files, extending or replacing the default look of the pages and blocks generated by LiteCommerce.
  • Resource files (images, styles, and so on) used by the above two groups.
  • YAML files with the data that is to be imported into the LiteCommerce database when the module is enabled.

Depending on the purpose of a certain module, it may miss some of the listed components: thus, a theme module is likely to miss scripts and data files, and a language module may include a single YAML file with the translation strings.

Modules are distributed in the form of a single package that includes all the module files. There are three ways to install a module in LiteCommerce:

  1. Unpack the module package manually and then copy the module files to the server. This is the most difficult (and least recommended) way, because here user must know which directories different groups of files are to be copied to.
  2. Upload the module package in the LiteCommerce back-end. It will be unpacked and copied to the appropriate directories automatically.
  3. We list popular modules in our Module Marketplace directory. LiteCommerce users can buy, install and update modules listed there directly from their LiteCommerce back-end. This is the easiest (and most recommended) way of installing LiteCommerce modules. You can submit your module to us for a review to be added to the Module Marketplace.

When a module is installed, it is listed in the LiteCommerce back-end and can be enabled by user. Until the module is enabled, it doesn’t affect LiteCommerce functionality, design or database. If user disables a module, all of its classes, templates and database data become hidden from LiteCommerce.

Table of contents

  1. Preparing for LiteCommerce module development
    • Installing LiteCommerce
    • Locating LiteCommerce files
    • Configuring developer-specific settings
  2. LC modular architecture
  3. Customizing LiteCommerce appearance
  4. Extending the LiteCommerce functionality
    • Extending LiteCommerce classes
    • Working with widget-lists
  5. Working with LiteCommerce models
  6. Multilingual support in LiteCommerce
    • Overview
    • Multilingual messages
    • Multilingual model fields
    • HOW TO: Creating translation module
  7. Integrating with third-party services
    • Integrating with payment systems
  8. LiteCommerce development: Best Practices
  9. Sample LiteCommerce modules
  10. LiteCommerce code HowTos
Clone this wiki locally