The section explains how to create a new Virto Commerce module.
Virto Commerce uses dotnet new
command to create a Virto Commerce module project based on a template.
- Open Windows PowerShell CMD .
- Run command to install Virto Commerce template.
dotnet new --install VirtoCommerce.Module.Template
To create a new Virto Commerce module project from template:
- Open Windows PowerShell CMD.
- Navigate to your sources folder.
- Run command.
dotnet new vc-module --ModuleName CustomerReviews --Author "Jon Doe" --CompanyName VirtoCommerce
vc-module-CustomerReviews
folder with solution should be created.
The command calls the template engine to create the artifacts on disk based on the Virto Commerce template and options.
Options | Description | Type | Required | Default value |
---|---|---|---|---|
--Author (or -A) | Your name | string | Optional | John Doe |
--CompanyName (or -C) | Your company name | string | Optional | VirtoCommerce |
--ModuleName (or -M) | Your module name | string | Optional | newModule |
--PlatformVersion (or -P) | Required Platform Version | string | Optional | 3.84.0 |
--PlatformNuGetPackageVersion (or -Pl) | Required Platform NuGet Package Version | string | Optional | 3.84.0 |
Virto Commerce CLI should be used to build, test and create a module package.
!!! note Also you can open solution in Visual Studio and use Visual Studio tools to build the module.
- Open Windows PowerShell CMD.
- Navigate to your sources folder. Ex: vc-module-{module-name}.
- Run command.
vc-build Compress
As a result you can find the module package in artifacts folder.
The module package can be uploaded and installed to the Virto Commerce Platform.
- Open and sign-in into Virto Commerce Admin Portal.
- Select
Modules
menu and selectAdvanced
section. - Install/update module from file.
- Restart the platform.
If the module is installed properly, you should see the new module in the list of installed modules, Admin UI and Swagger API.