Skip to content

Module Development#


Welcome to the Module Development Series from Miva Merchant. In this series, we’ll guide you through building a Miva Merchant module, a plugin for the Miva Merchant Software, enabling you to extend its functionality or integrate with third-party systems.

Introduction to Miva Merchant Ecosystem#

Before delving into the Miva Merchant API and code examples, let’s understand the Miva Merchant Ecosystem. There are four main components:

  1. MivaScript Language:

    • Miva Merchant utilizes its own scripting language called MivaScript, which predates languages like PHP and has been around since the mid-90s. It’s powerful and provides flexibility for module development.
  2. Compiler:

    • Similar to compiled languages like C++, MivaScript is compiled into machine-readable bytecode. The Compiler processes MivaScript files, producing compiled files that can be executed by the Miva engine.
  3. Engine (Empressa):

    • Empressa serves as the backbone of the Miva Merchant System, running MivaScript code. It must be installed on web servers where MivaScript code, including Miva Merchant, will run.
  4. Miva Merchant Software:

    • The software itself is written in MivaScript and consists of modules. Modules are MivaScript files compiled using the Miva Merchant API, allowing third-party developers to create plugins that integrate seamlessly with Miva Merchant’s core functionality.

Detailed Overview of Components#

MivaScript Language#

We’ll explore the syntax and structure of MivaScript, demonstrating how it’s used to develop Miva Merchant modules. Despite its initial learning curve, MivaScript offers tremendous capabilities for web scripting.

Compiler#

The MivaScript Compiler, available for both Windows and Linux, processes raw MivaScript source code into compiled files, which are then executed by the Miva engine. We’ll provide installation instructions in upcoming videos.

Engine (Empressa)#

Empressa is essential for running MivaScript code. It’s required on any web server where MivaScript, including Miva Merchant, is deployed. Empressa supports various operating systems, including Linux and Windows.

Miva Merchant Software#

Miva Merchant is the core software, written in MivaScript. It comprises modules developed using the Miva Merchant API, facilitating seamless integration of third-party plugins. We’ll delve into the module API in later sections.

Developer Store#

Before you start building modules for Miva Merchant, you need to set up your development environment. This involves two main steps: obtaining a free Developer Store and downloading/installing the compiler.

  1. Sign Up for a Developer Store:

    • Visit our Sandbox Store to sign up for a free Developer Store. - Fill in all required information and create a password. Each email address is limited to one Developer Store.
  2. Activation and Approval:

    • Once you’ve filled out the information, your Developer Store will be created. You’ll receive an email with your login credentials.
    • Please note that every Developer Store request is reviewed and approved manually. This process may take 24-48 hours, although during business hours, it’s typically quicker.
  3. Accessing Your Developer Store:

    • The email you receive will contain a pre-generated URL starting with dts followed by a four-digit number, then mivamerchant.com. It includes paths to both the Miva Merchant Storefront and Admin.
    • Your login credentials will include the Miva Merchant Username (your email address) and the password you created during sign up.
    • FTP access is also provided. The username is your email address followed by the Miva Developer Store URL, and the password is the same one used during sign up.
    • Clicking on the provided link in the email should take you directly to the Miva Merchant Admin of your Developer Store.
  4. Accessing Control Panel:

    • You’ll have access to a control panel where you can manage your website and database. Visit https://cp.mivamerchant.com and log in using your email address as the username and the FTP Miva login password.
  5. Database Management:

    • In the control panel, navigate to “Scripts and Databases” > “MySQL Databases”. You’ll find a pre-created database and user, automatically generated during Miva Merchant installation.
    • Access the phpMyAdmin interface by clicking the “Manage” link next to your database. Use the database username and the same password used for FTP and Miva Admin login.
    • phpMyAdmin provides access to the entire Miva Merchant Database, useful for debugging module-related issues and ensuring database functions work correctly.

With your Developer Store set up, you’re ready to start building and testing modules for Miva Merchant.