melisplatform/melis-demo-commerce
Composer 安装命令:
composer require melisplatform/melis-demo-commerce
包简介
Official Melis Platform Demo Site
README 文档
README
Module:
melisplatform/melis-demo-commerce· Namespace:MelisDemoCommerce·melis-site: true·melis-module-category: commerceAudience: end users · developers · AI agents What it is: a ready-made demo e-commerce storefront site for MelisPlatform (the commerce counterpart ofmelis-demo-cms) — a full front office (catalog, product/variant pages, cart, multi-step checkout, account, orders) plus a one-time setup wizard that seeds a complete demo catalog (products, variants, categories, attributes, prices, stock, a coupon and sample clients/orders). Built on themelis-commerceengine.
A ready-made demo e-commerce site for the Melis Platform.
It is the commerce counterpart of melis-demo-cms: a full storefront (catalog, product/variant
pages, cart, checkout, account, orders) plus a seeded demo catalog (products, variants, categories,
attributes, prices, stock, a coupon, and sample clients/orders).
This module is a site module — it is referenced from vendor/ and registered with the platform,
then its demo data is installed through a one-time setup wizard.
Requirements
Before installing this module you need a working Melis Platform with:
- PHP 8.1 or 8.3
- A platform already installed (database created, the
melis_core_platformrow present, and the DbDeploy migrations run). Visiting/melisshould give you a working back office. - The MelisCommerce engine installed and its DbDeploy run, so the
melis_ecom_*tables and the commerce reference data (countries, currencies, commerce languages, attribute types, document types) already exist. - These dependency modules installed (pulled automatically by Composer):
melis-commerce,melis-cms,melis-cms-slider,melis-cms-prospects,melis-cms-news,melis-cms-page-script-editor.
The setup wizard adds a new site to your platform. It does not overwrite existing sites, and it resolves all database IDs at runtime — so it can be installed onto a platform that already hosts other sites (e.g. the CMS demo).
How the install works (in short)
- Composer places the module in
vendor/melisplatform/melis-demo-commerceand records itsextra.module-nameso the platform can find it. - You register the module so the platform loads it.
- You open
/MelisDemoCommerce/setupon a domain that is not yet bound to another site. - The wizard runs 15 steps, creating the site, pages, templates, sliders, news, the commerce
catalog (attributes → products → categories → variants → prices → stock), a coupon and sample
clients/orders. Unknown IDs are resolved as rows are inserted and written back into the site's
generated config files (the
[:token]placeholders inconfig/*.dist).
Manual installation
1. Get the module with Composer
If it is already listed in your project's composer.json, just install dependencies:
composer install
Otherwise add it:
composer require melisplatform/melis-demo-commerce
If you edited the module after installing (e.g. pulled a branch), refresh Composer's autoload so the
Module class and namespace map are picked up:
composer dump-autoload
2. Register the module's path with the platform
This is a site module — it is loaded for its own front domain through the vhost's
MELIS_MODULE env (step 4), not through the back-office module list.
⚠️ Do NOT add
MelisDemoCommercetoconfig/melis.module.load.php. That file is the back-office module list; adding a site module there makes the platform treat every/MelisDemoCommerce/*URL as a back-office request and redirect it to/melis/login, so the setup wizard becomes unreachable.
The module only needs to be in the path map so the platform can locate it. Add it to
config/melis.modules.path.php:
'MelisDemoCommerce' => '/vendor/melisplatform/melis-demo-commerce',
(Or simply delete config/melis.modules.path.php — it is regenerated on the next request from the
installed packages, picking up this module via its composer.json extra.module-name.) Then clear
the platform cache:
rm -rf cache/meliscore_platform_cache-* cache/config/*
3. Make the required paths writable
The wizard copies product/category images and writes the site's generated config files, so these must be writable by the web server:
public/media/(the wizard createspublic/media/commerce/inside it)vendor/melisplatform/melis-demo-commerce/config/(it generatesmodule.config.php,melis.plugins.config.phpandMelisDemoCommerce.config.phpfrom the*.disttemplates)
4. Set up a domain / virtual host
Point a virtual host at the project's public/ directory using a domain that is not already used
by another site on this platform (the front engine routes by domain — a domain bound to another
site will intercept /MelisDemoCommerce/setup). Declare the platform and this module via env vars:
<VirtualHost *:80> DocumentRoot "/path/to/project/public" ServerName www.mycommerce.local <Directory "/path/to/project/public"> Options -Indexes +FollowSymLinks +ExecCGI DirectoryIndex index.php AllowOverride All Require all granted </Directory> SetEnv MELIS_PLATFORM "local" # your platform/environment name SetEnv MELIS_MODULE "MelisDemoCommerce" </VirtualHost>
Add the domain to your hosts file:
127.0.0.1 www.mycommerce.local
Restart/reload the web server.
5. Run the setup wizard
Open:
http://www.mycommerce.local/MelisDemoCommerce/setup
Fill in:
- Protocol –
httporhttps - Site Domain – the domain you just configured (e.g.
www.mycommerce.local) - Site Label – a display name (e.g.
My Commerce Site)
Click Start setup. The wizard runs these steps automatically (the products and variants steps are large and take longest — let it finish):
site → templates → pages → sliders → news → prospects_theme → document_types → attributes → product_text_types → products → categories → variants → coupons → client_and_orders → setup_main_page
When you see “MelisDemoCommerce setup completed.” the install is done.
6. Verify
Browse to http://www.mycommerce.local/ — you should see the demo storefront with categories,
products and prices.
Re-running the install
Each run regenerates the site's config files from the *.dist templates, but it does not delete
data it previously inserted — re-running on the same database will create duplicate rows. To start
over cleanly, restore the database to its pre-install state first, then run the wizard again.
Troubleshooting
| Symptom | Cause / fix |
|---|---|
/MelisDemoCommerce/setup redirects to /melis/login |
MelisDemoCommerce was added to config/melis.module.load.php (the back-office list) — remove it. A site module is loaded via the vhost's MELIS_MODULE, not that list. |
Blank page / 404 at /MelisDemoCommerce/setup |
The domain is already bound to another site (use an unbound domain), or MELIS_MODULE isn't set on the vhost. Clear cache/. |
Access permission denied … make … writable |
Make public/media/ and the module's config/ directory writable. |
Current Platform "" has no data on database |
MELIS_PLATFORM isn't set for this vhost, or the platform isn't installed. Set SetEnv MELIS_PLATFORM. |
| Module won't initialize / class not found | Run composer dump-autoload. |
Setup stops on client_and_orders |
MELIS_MODULE isn't set for the vhost — add SetEnv MELIS_MODULE "MelisDemoCommerce". |
Support
melisplatform/melis-demo-commerce 适用场景与选型建议
melisplatform/melis-demo-commerce 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zf2」 「module」 「cms」 「melis」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 melisplatform/melis-demo-commerce 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 melisplatform/melis-demo-commerce 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 melisplatform/melis-demo-commerce 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LosLog provides some log utility
GraphQL authentication for your headless Craft CMS applications.
EdpModuleLayouts is very simple Laminas module for making module-specific layouts insanely easy.
Set Links with a specific language parameter
Supercharged text field validation.
Zend Framework module to leverage the symfony dependency injection container
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2024-08-06