2.0 MVC Beta Source -- (TaxSercvice.cs) Error in installing

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Information:

1. nopCommerce version - 2.0 BETA Source
2. Any private modifications you made to your nopCommerce - NO (Except below)
3. The version of MS SQL database you're running nopCommerce with - 2008

I cannot install 2.0 Beta because of "TaxService.cs."
The problem is as follows,

            var activeTaxProvider = LoadActiveTaxProvider();


When activeTaxProvider is set null, installation will stop. So I changed like this. Installation was completed

        /// <summary>
        /// Gets tax rate
        /// </summary>
        /// <param name="productVariant">Product variant</param>
        /// <param name="taxCategoryId">Tax category identifier</param>
        /// <param name="customer">Customer</param>
        /// <returns>Tax rate</returns>
        public virtual decimal GetTaxRate(ProductVariant productVariant, int taxCategoryId,
           Customer customer)
        {
            //tax exempt
            if (IsTaxExempt(productVariant, customer))
            {
                return decimal.Zero;
            }

            //tax request
            var calculateTaxRequest = CreateCalculateTaxRequest(productVariant, taxCategoryId, customer);

            //make EU VAT exempt validation (the European Union Value Added Tax)
            if (_taxSettings.EuVatEnabled)
            {
                if (IsVatExempt(calculateTaxRequest.Address, calculateTaxRequest.Customer))
                {
                    //return zero if VAT is not chargeable
                    return decimal.Zero;
                }
            }

            //active tax provider
            var activeTaxProvider = LoadActiveTaxProvider();

            ////////////////  Modified  Start ///////////////////////////////////////////////////////////////////////////////
            //get tax rate
            if (activeTaxProvider != null)
            {
                var calculateTaxResult = activeTaxProvider.GetTaxRate(calculateTaxRequest);
                if (calculateTaxResult.Success)
                    return calculateTaxResult.TaxRate;
                else
                    return decimal.Zero;
            }
            else
            {
                return decimal.Zero;
            }
            ////////////////  Modified  End /////////////////////////////////////////////////////////////////////////////////////
        }
12 years ago
https://www.nopcommerce.com/boards/t/10664/nop-2-fresh-install-object-reference-not-set-to-an-instance-of-an-object.aspx
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.