1 Star 0 Fork 0

wesleyfang / vc-platform

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
connect-storefront-to-platform-v3.md 4.09 KB
一键复制 编辑 原始数据 按行查看 历史

Deploy storefront kit

Virto Commerce Storefront Kit is Official online shopping website based on VirtoCommerce Platform written on ASP.NET Core. The website is a client application for VC Platform and uses only public APIs while communicating.

!!! note If Platform and Storefront are deployed in the same on-premises environment, Storefront should be deployed on different port then Platform. You can do it by dotnet run CLI

Downloading the precomplied binaries

  • Navigate to the Releases section of Virto Commerce Storefront Kit in GitHub.

  • You will find VirtoCommerce.Storefront.5.x.x.zip file. In this file the site has already been built and can be run without additional compilation. The source code is not included.

  • Unpack this zip to a local directory C:\vc-storefront. After that you will have the directory with Storefront precompiled files.

Setup

Configure application strings

  • Open the appsettings.json file in a text editor.
  • In the Endpoint section change Url, UserName, Password with correct path and credentials for Virto Commerce Platform:
...
 "Endpoint": {
     "Url": "https://localhost:5001",
     "UserName": "admin",
     "Password": "store",

Configure CMS Content storage

Storefront appsettings.json file contains ContentConnectionString setting with pointed to the folder with actual themes and pages content

...
"ConnectionStrings": {
    //For themes stored in local file system
    "ContentConnectionString": "provider=LocalStorage;rootPath=~/cms-content"
	//For themes stored in azure blob storage
    //"ContentConnectionString" connectionString="provider=AzureBlobStorage;rootPath=cms-content;DefaultEndpointsProtocol=https;AccountName=yourAccountName;AccountKey=yourAccountKey"
  },
...

You can set this connection string in one of the following ways:

  1. Build and Copy theme to wwwroot\cms-content\{StoreName}\{ThemeName}
  2. If you have already have installed platform with sample data, your platform already contains ~/App_Data/cms-content folder with themes for sample stores and you need only to make symbolic link to this folder by this command:
    mklink /d C:\vc-storefront\VirtoCommerce.Storefront\wwwroot\cms-content C:\vc-platform\VirtoCommerce.Platform.Web\App_Data\cms-content

On Mac OS and Linux: console ln -s ~/vc-storefront/wwwroot/cms-content ~/vc-platform/wwwroot/cms-content

  1. If you did not install sample data with your platform, you need to create new store in platform manager and download themes as it described in this article: Theme development

Running the Storefront only on HTTP schema

  • In order to run the platform only at HTTP schema in production mode, it's enough to pass only HTTP URLs in --urls argument of the dotnet command.
  dotnet VirtoCommerce.Storefront.dll --urls=http://localhost:5002

Running the Platform on HTTPS schema

  • Install and trust HTTPS certificate

Run to trust the .NET Core SDK HTTPS development certificate:

    dotnet dev-certs https --trust

Read more about enforcing HTTPS in ASP.NET Core

    dotnet VirtoCommerce.Storefront.dll --urls=https://localhost:4302/
  • Trust the .Net Core Development Self-Signed Certificate. More details on trusting the self-signed certificate can be found here

Sample themes

Default theme

electronics

B2B theme

img_20102017_174148_0

C#
1
https://gitee.com/wesleyfang/vc-platform.git
git@gitee.com:wesleyfang/vc-platform.git
wesleyfang
vc-platform
vc-platform
master

搜索帮助