Beispiel #1
0
    /// <summary>
    /// Indicates if exchange rate from global main currency is needed.
    /// </summary>
    protected bool IsFromGlobalRateNeeded()
    {
        string siteName = SiteInfoProvider.GetSiteName(ConfiguredSiteID);

        if ((ConfiguredSiteID == 0) || (ECommerceSettings.UseGlobalCurrencies(siteName)))
        {
            return(false);
        }

        string globalMainCode = CurrencyInfoProvider.GetMainCurrencyCode(0);
        string siteMainCode   = CurrencyInfoProvider.GetMainCurrencyCode(ConfiguredSiteID);

        // Check whether main currencies are defined
        if (string.IsNullOrEmpty(siteMainCode) || string.IsNullOrEmpty(globalMainCode))
        {
            return(false);
        }

        // Check whether global and site main currency are the same
        if (globalMainCode.ToLowerCSafe() == siteMainCode.ToLowerCSafe())
        {
            return(false);
        }

        return(ECommerceSettings.AllowGlobalDiscountCoupons(siteName) ||
               ECommerceSettings.AllowGlobalProductOptions(siteName) ||
               ECommerceSettings.AllowGlobalProducts(siteName) ||
               ECommerceSettings.AllowGlobalShippingOptions(siteName) ||
               ECommerceSettings.UseGlobalCredit(siteName) ||
               ECommerceSettings.UseGlobalTaxClasses(siteName));
    }