Exemplo n.º 1
0
    /// <summary>
    /// Logs activity
    /// </summary>
    /// <param name="skuId">SKU ID</param>
    /// <param name="skuName">Product name</param>
    /// <param name="siteId">Site ID</param>
    private void LogProductAddedToWLActivity(int skuId, string skuName, int siteId)
    {
        if ((currentUser == null) || (CMSContext.ViewMode != ViewModeEnum.LiveSite) || !ActivitySettingsHelper.ActivitiesEnabledAndModuleLoaded(siteId) ||
            !ActivitySettingsHelper.ActivitiesEnabledForThisUser(currentUser) || !ActivitySettingsHelper.AddingProductToWLEnabled(siteId))
        {
            return;
        }

        var data = new ActivityData()
        {
            ContactID = ModuleCommands.OnlineMarketingGetCurrentContactID(),
            SiteID    = siteId,
            Type      = PredefinedActivityType.PRODUCT_ADDED_TO_WISHLIST,
            TitleData = skuName,
            ItemID    = skuId,
            URL       = URLHelper.CurrentRelativePath,
            Campaign  = CMSContext.Campaign
        };

        ActivityLogProvider.LogActivity(data);
    }