Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

1.1 KB
Raw Blame
using Grand.Domain.Stores;
using Microsoft.AspNetCore.Http;

namespace Grand.Module.Installer.Services;

public partial class InstallationService
{
    protected virtual async Task InstallStores(
        string httpscheme, HostString host,
        string? companyName, string? companyAddress, string? companyPhoneNumber, string? companyEmail)
    {
        var store =
            new Store {
                Name = "Your store name",
                Shortcut = "Store",
                Url = $"{httpscheme}://{host}/",
                DisplayOrder = 1,
                CompanyName = companyName,
                CompanyAddress = companyAddress,
                CompanyPhoneNumber = companyPhoneNumber,
                CompanyRegNo = null,
                CompanyVat = null,
                CompanyEmail = companyEmail,
                CompanyHours = "Monday - Sunday / 8:00AM - 6:00PM",
                Domains = new List<DomainHost>
                    { new() { HostName = host.Value, Url = $"{httpscheme}://{host}/", Primary = true } }
            };

        store = await _storeRepository.InsertAsync(store);

        await InstallDataRobotsTxt(store);
    }
}