Official documentation

ModernCommerce documentation

Install, configure, operate, and extend the Moodle-native commerce platform.

Version 2.1.8

Modern Commerce: Installation


Before you start

Confirm your environment meets the Requirements: Moodle 5.2, PHP 8.3+, HTTPS in production, Composer available, and Moodle cron running.

Install the plugin

Copy the plugin so its path is:

local/moderncommerce

The folder must be named moderncommerce: Moodle derives the component local_moderncommerce from it.

Install PHP dependencies (Composer)

The repository ships a composer.json. From the plugin directory, install its PHP dependencies:

cd local/moderncommerce composer install --no-dev --optimize-autoloader

Run the Moodle upgrade

Complete the database install by visiting Site administration → Notifications, or from the Moodle root:

php admin/cli/upgrade.php

Then confirm the plugin appears under:

Site administration → Plugins → Local plugins → Modern Commerce

Seed install defaults

On a new site, seed safe starting defaults, including gateway records, email templates, storefront widgets, and role presets, before you configure anything:

php local/moderncommerce/cli/demo_data.php --install-defaults

This seeds a real starting configuration, not demo content. Full demo data (--seed) is for development/staging only and creates sample courses, orders, and buyers.

First-run configuration

Open the day-to-day store settings at Modern Commerce → Settings (/local/moderncommerce/admin/settings.php) and set at least:

  1. Store identity: business name and support email.
  2. Currency: pick the active store currency before creating any prices (default NGN).
  3. Tax: mode and default rate, before opening checkout.
  4. Payment gateways: connect at least one merchant account (see Payments).
  5. Checkout fields, navigation labels, and notification sender/support details.

Deeper configuration (webhook security, notification delivery channels, branding seeds, subscription defaults) lives in Moodle's native plugin settings under Site administration → Plugins → Local plugins → Modern Commerce. Both surfaces write to the same config store. See the Admin Settings Reference.

Confirm cron is running: nothing in the notification, subscription, or reporting pipeline works without it.

To make your site root open the storefront, set both of these under Site administration → Appearance → Navigation (/admin/settings.php?section=navigation):

  1. Tick Enable Home (enablemyhome) — required, and off by default on a fresh Moodle 5.x site.
  2. Set Start page for users (defaulthomepage) to Modern Commerce storefront.
php admin/cli/cfg.php --name=enablemyhome --set=1 php admin/cli/cfg.php --name=defaulthomepage --set=/local/moderncommerce/index.php php admin/cli/purge_caches.php

Leaving Enable Home unticked is the usual cause of a site that opens the store for logged-in users and the login page for everyone else. See Storefront & widgets for the anonymous-access requirements that go with it.

Verify the install

  1. Visit the storefront at /local/moderncommerce/index.php.

  2. Visit the admin dashboard at /local/moderncommerce/admin/index.php as a manager.

  3. Audit which tables have data:

    php local/moderncommerce/cli/demo_data.php --audit

Uninstalling

Uninstall from Site administration → Plugins → Plugins overview → Modern Commerce → Uninstall. This removes the plugin and its data. Export any orders, invoices, or reports you need to keep first: see Orders, Invoices & Refunds.

Where to go next

Keep the documentation aligned with every release.

Support the source review, examples, compatibility checks, and editing required to keep implementation guidance accurate as Moodle evolves.

Support development Voluntary support. The core stays GPL.