public virtual ShippingOptionResponse GetShippingOptions(
            ShippingOptionRequest shippingOptionRequest,
            string allowedShippingRateComputationMethodSystemName = "")
        {
            Guard.NotNull(shippingOptionRequest, nameof(shippingOptionRequest));

            var computationMethods = LoadActiveShippingRateComputationMethods(shippingOptionRequest.StoreId)
                                     .Where(x => allowedShippingRateComputationMethodSystemName.IsEmpty() ||
                                            allowedShippingRateComputationMethodSystemName == x.Metadata.SystemName)
                                     .ToList();

            if (computationMethods.IsNullOrEmpty())
            {
                throw new SmartException(T("Shipping.CouldNotLoadMethod"));
            }

            // Get shipping options
            var result = new ShippingOptionResponse();

            foreach (var method in computationMethods)
            {
                var response = method.Value.GetShippingOptions(shippingOptionRequest);
                foreach (var option in response.ShippingOptions)
                {
                    option.ShippingRateComputationMethodSystemName = method.Metadata.SystemName;
                    option.Rate = _workContext.WorkingCurrency.RoundIfEnabledFor(option.Rate);

                    result.ShippingOptions.Add(option);
                }

                // Log errors
                if (!response.Success)
                {
                    foreach (var error in response.Errors)
                    {
                        result.Errors.Add(error);
                        if (!shippingOptionRequest.Items.IsNullOrEmpty())
                        {
                            Logger.Warn(error);
                        }
                    }
                }
            }

            // Return valid options if any present (ignores the errors returned by other shipping rate compuation methods)
            if (_shippingSettings.ReturnValidOptionsIfThereAreAny && result.ShippingOptions.Count > 0 && !result.Success)
            {
                result.Errors.Clear();
            }

            // No shipping options loaded
            if (result.ShippingOptions.Count == 0 && result.Success)
            {
                result.Errors.Add(T("Checkout.ShippingOptionCouldNotBeLoaded"));
            }

            return(result);
        }
        public virtual ShippingOptionRequest CreateShippingOptionRequest(IList <OrganizedShoppingCartItem> cart, Address shippingAddress, int storeId)
        {
            var shipping = cart.Where(x => x.Item.IsShippingEnabled);
            var request  = new ShippingOptionRequest
            {
                StoreId           = storeId,
                Customer          = cart.GetCustomer(),
                ShippingAddress   = shippingAddress,
                CountryFrom       = null,
                StateProvinceFrom = null,
                ZipPostalCodeFrom = string.Empty,

                Items = new List <OrganizedShoppingCartItem>(shipping)
            };

            return(request);
        }