Exemplo n.º 1
0
        public IList <ShippingMethod> CalculateShipping(ShoppingCart cart)
        {
            //pull the rates
            var shippingMethods = ShippingMethod.All().ToList();

            //loop the methods and set the cost
            shippingMethods.ForEach(x => x.CalculateCost(cart));
            return(shippingMethods);
        }
        private void EnableShippingMethodForCatalog(ProductCatalogGroup catalogGroup)
        {
            var shippingMethods = ShippingMethod.All();

            foreach (var method in shippingMethods)
            {
                method.ClearEligibleProductCatalogGroups();
                method.AddEligibleProductCatalogGroup(catalogGroup);
                method.Save();
            }
        }