Minimum amount on ShipMethod charged AFTER discounts

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Minimum amount on ShipMethod charged AFTER discounts

Post by mfreeze » Fri Jun 05, 2009 12:09 pm

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?
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: Minimum amount on ShipMethod charged AFTER discounts

Post by mfreeze » Fri Jun 05, 2009 12:59 pm

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.
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Minimum amount on ShipMethod charged AFTER discounts

Post by mazhar » Tue Jun 09, 2009 4:03 am

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();

Post Reply