Page 1 of 1

Minimum amount on ShipMethod charged AFTER discounts

Posted: Fri Jun 05, 2009 12:09 pm
by mfreeze
We have a 'free shipping' method set up with a minimum purchase amount of $50.00. When a customer purchases an item with a regular price above this amount then applies a coupon code that takes the total order below it, the free shipping method is applied.

We want the minimum purchase amount calculated based on the total in the basket before any coupons are applied. Is there a way to do this?

Re: Minimum amount on ShipMethod charged AFTER discounts

Posted: Fri Jun 05, 2009 12:59 pm
by mfreeze
Sorry. I misunderstood the problem my customer was reporting. I had it just the opposite.

The 'free shipping' is set up for a minimum purchase of $50. If a customer buys a product for more than $50 then applies a coupon code that takes the amount below $50, free shipping is still an option and it should not be.

So it appears that the minimum is being calculated on the total order BEFORE the coupon code is applied.

The coupon code does not appear to be changing the calculation of the minimum purchase amount.

Re: Minimum amount on ShipMethod charged AFTER discounts

Posted: Tue Jun 09, 2009 4:03 am
by mazhar
You can try following code to made a check deeding upon total product price of a basket. Locate following code in your ConLib/OnePageCheckout.ascx.cs file

Code: Select all

ShipMethodList.DataSource = localQuotes;
ShipMethodList.DataBind();
and then change it as below

Code: Select all

List<LocalShipRateQuote> notAllowed = new List<LocalShipRateQuote>();
                foreach (LocalShipRateQuote lsrq in localQuotes)
                {
                    ShipMethod shipMethod = ShipMethodDataSource.Load(lsrq.ShipMethodId);
                    if (shipMethod.MinPurchase > 0 && Token.Instance.User.Basket.Items.TotalProductPrice < shipMethod.MinPurchase)
                        notAllowed.Add(lsrq);
                }
                foreach (LocalShipRateQuote lsrq in notAllowed)
                    localQuotes.Remove(lsrq);

ShipMethodList.DataSource = localQuotes;
ShipMethodList.DataBind();