Download the PHP package lyrasoft/melo without Composer
On this page you can find all versions of the php package lyrasoft/melo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lyrasoft/melo
More information about lyrasoft/melo
Files in lyrasoft/melo
Informations about the package melo
LYRASOFT Melo Package
- Installation
- Seeders
- Global Settings
- Session
- Favorites Type
- Language Files
- CSS/JS
- Add Cart Button
- Register Admin Menu
- Frontend Available Routes
Installation
Install from composer
melo dependents on lyrasoft/sequence and lyrasoft/favorite packages. Please read their README and configure them first.
Then copy files to project
Seeders
Add these files to resources/seeders/main.php
Add these types to category-seeder.php
Global Settings
Open /etc/packages/melo.php, you can configure there settings:
File Upload
Melo will need video upload profile, so we need to add video profile to file_upload profiles
After you configure the base settings, you should not change it after site release. And then you can run migtaiotns/seeders, all orders No and faker locale will use this setting.
Session
As melo may need to redirect to outside Payment service to process checkout, you must disable SameSite cookie poilicy
and set secure as TRUE.
Favorites Type
melo will auto install lyrasoft/favorite and copy config file. You must add product to allow_types to allow
AJAX call.
Attachment
先到 unicorn.php 中註冊 AttachmentPackage
Language Files
Add this line to admin & front middleware if you don't want to override languages:
Or run this command to copy languages files:
CSS/JS
melo dependents on lyrasoft/favorite, you must add these vendors to fusionfile.mjs
Then run this command to install npm vendors:
Add Cart Button
Please call useLessonCartButtons() at the page where you want to use "Add to Cart" button,
or just call it at main.ts.
Then you must includes these 2 attributes to make aff-to-cart buttons work:
[data-melo-task=buy][data-id=lesson-id]
You can customize the selector to select different buttons to buy lesson, by default, when button clicked,
you will be redirected to lesson_cart page for instantly purchasing.
You can also customize your add-to-cart flow, to disable the default behavior, just cancel the first argument.
Update Cart Count
Add attributes like below to your cart button badge, and the count will be updated automatically when you add lesson to cart.
When cart items is not 0, melo will add h-has-items to button class, you can display or hide badge with this class.
Otherwise you can listen to events
Register Admin Menu
Edit resources/menu/admin/sidemenu.menu.php
Frontend Available Routes
lesson_listlesson_itemmy_lesson_listmy_lecture_listmelo_my_order_listmelo__my_order_itemmelo_cart
All versions of melo with dependencies
lyrasoft/luna Version ^2.2
lyrasoft/favorite Version ^1.0||^2.0
lyrasoft/attachment Version ^1.0
asika/better-units Version ^0.2.0
brick/math Version *