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.

999 B
Raw Blame
using Grand.Business.Core.Interfaces.Cms;

namespace Widgets.GoogleAnalytics;

public class GoogleAnalyticsConsentCookie : IConsentCookie
{
    private readonly GoogleAnalyticsEcommerceSettings _googleAnalyticsEcommerceSettings;

    public GoogleAnalyticsConsentCookie(GoogleAnalyticsEcommerceSettings googleAnalyticsEcommerceSettings)
    {
        _googleAnalyticsEcommerceSettings = googleAnalyticsEcommerceSettings;
    }

    public string SystemName => GoogleAnalyticDefaults.ConsentCookieSystemName;

    public bool AllowToDisable => _googleAnalyticsEcommerceSettings.AllowToDisableConsentCookie;

    public bool? DefaultState => _googleAnalyticsEcommerceSettings.ConsentDefaultState;

    public int DisplayOrder => 10;

    public Task<string> FullDescription()
    {
        return Task.FromResult(_googleAnalyticsEcommerceSettings.ConsentDescription);
    }

    public Task<string> Name()
    {
        return Task.FromResult(_googleAnalyticsEcommerceSettings.ConsentName);
    }
}