Free Shipping and the UPS module

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 年 前
Hi all,

On our site we have some items which are bundled with free shipping and others that are not.

However it seems that the UPS module sends across the weights and dimensions for these items when calculating a quote?

For example if i send a single item (where shipping is to be charged) i may get a shipping rate of x.

However if i then have the same item along with an item that has free shipping enabled the cost goes up.

BUT, if i have only the item with free shipping in the shopping basket then the shipping that is returned is free? which doesnt seem to make sense.

has anyone else come across this issue?

Matt
13 年 前
Hi,

I've sorted the problem by simply making the following change to the weight calculation?

        /// <summary>
        /// Gets shopping cart weight difference is this will not include any items which are flagged with free shipping
        /// </summary>
        /// <param name="cart">Cart</param>
        /// <param name="customer">Customer</param>
        /// <returns>Shopping cart weight</returns>
        public static decimal GetShoppingCartTotalWeight(ShoppingCart cart, Customer customer)
        {
            decimal totalWeight = decimal.Zero;

            //shopping cart items
            foreach (var shoppingCartItem in cart)
                if(!shoppingCartItem.IsFreeShipping)
                    totalWeight += shoppingCartItem.TotalWeigth;

            //checkout attributes
            if (customer != null)
            {
                var caValues = CheckoutAttributeHelper.ParseCheckoutAttributeValues(customer.CheckoutAttributes);
                foreach (var caValue in caValues)
                    totalWeight += caValue.WeightAdjustment;
            }
            return totalWeight;
        }

will this have any implications?

Matt
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.