Modern Commerce: Installation
- Before you start
- Install the plugin
- Install PHP dependencies (Composer)
- Run the Moodle upgrade
- Seed install defaults
- First-run configuration
- Verify the install
- Uninstalling
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 componentlocal_moderncommercefrom 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:
- Store identity: business name and support email.
- Currency: pick the active store currency before creating any prices (default NGN).
- Tax: mode and default rate, before opening checkout.
- Payment gateways: connect at least one merchant account (see Payments).
- 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):
- Tick Enable Home (
enablemyhome) — required, and off by default on a fresh Moodle 5.x site. - 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
-
Visit the storefront at
/local/moderncommerce/index.php. -
Visit the admin dashboard at
/local/moderncommerce/admin/index.phpas a manager. -
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.