Cant change quantity in cart once discount is applied

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
richa
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Thu Jan 20, 2011 1:50 pm

Cant change quantity in cart once discount is applied

Post by richa » Thu Jan 20, 2011 1:52 pm

AbleCommerce version? 7.0.5 build 14053
In the Shopping cart, you can change the quantity of any item, until a discount is applied. Once a discount is applied, you can change the quantity of only the first item in the cart.

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Cant change quantity in cart once discount is applied

Post by jmestep » Fri Jan 21, 2011 7:28 am

Do you have custom code on the basket? I'm not seeing that problem in a 7.0.5 site.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

richa
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Thu Jan 20, 2011 1:50 pm

Re: Cant change quantity in cart once discount is applied

Post by richa » Fri Jan 21, 2011 8:01 am

we call a method: ShowDiscountMessageInfo(); in page load in basket.ascx.cs

Code: Select all

private void ShowDiscountMessageInfo()
    {
        VolumeDiscountCollection volumeDiscountCollection = VolumeDiscountDataSource.LoadForStore();
        for (int i = 0; i < volumeDiscountCollection.Count; i++)
        {
            VolumeDiscount volumeDiscount = volumeDiscountCollection[i];

            if (string.Compare(volumeDiscount.Name, "new discount", StringComparison.OrdinalIgnoreCase) == 0)
            {
                VolumeDiscountLevelCollection volumeDiscountLevelCollection = volumeDiscountCollection[i].Levels;
                BasketHelper.SaveBasket(BasketGrid);
                BindBasketGrid();

                LSDecimal subTotalOfCart = GetBasketSubtotalWithoutDiscount();

                bool discountApplied = false;
                for (int j = 0; j < volumeDiscountLevelCollection.Count; j++)
                {
                    VolumeDiscountLevel volumeDiscountLevel = volumeDiscountLevelCollection[j];
                    if (volumeDiscountLevel.MinValue - subTotalOfCart < 10 &&
                        volumeDiscountLevel.MinValue - subTotalOfCart > 0)
                    {
                        bool isPercent = volumeDiscountLevel.IsPercent;
                        string discountAmount = string.Empty;
                        if (isPercent)
                        {
                            discountAmount = (volumeDiscountLevel.DiscountAmount / 100).ToString("0.00%");
                        }
                        else
                        {
                            discountAmount = volumeDiscountLevel.DiscountAmount.ToString("C");
                        }
                        lblDiscountInfo.Text = (volumeDiscountLevel.MinValue - subTotalOfCart).ToString("C") +
                                               " more and you will save " + discountAmount + " on your entire order";
                        discountApplied = true;
                        break;
                    }
                }
                if (!discountApplied)
                {
                    divDiscountInfo.Visible = false;
                }
                else
                {
                    divDiscountInfo.Visible = true;
                }
            }
        }
    }
i put this additional code in a clean install and it works fine. but just doesnt work on the real website....

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Cant change quantity in cart once discount is applied

Post by jmestep » Fri Jan 21, 2011 9:11 am

There has to be some other difference on the live site. Try checking for nulls in your code and see if that helps.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Post Reply