custom Cart Total in Header is incorrect--Need help

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
alee337
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 33
Joined: Fri Sep 26, 2008 4:17 pm

custom Cart Total in Header is incorrect--Need help

Post by alee337 » Tue Oct 14, 2008 12:21 pm

My programmer has added a cart item(s) # as well as dollar amount to the header, but we are experiencing a small problem. Whenever adding items to the cart, the number of items shown as well as total amount is right. But as soon as you checkout, this is where the problem occurs.

Once you select a shipping method, it adds 1 item to the cart (but total $ amount doesn't change). Also, when you add a coupon code, it adds another item to the cart (again, the $ amount of the cart doesnt change, which is right). What now happens is the basket total in the header shows 3 items (1 for the actual product, 1 for shipping and 1 for coupon code). We only want it to display 1 item, as this is the correct number.

See attached screenshot. Could someone let us know how to fix this?

Thanks again AbleCommerce members!

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: custom Cart Total in Header is incorrect--Need help

Post by Shopping Cart Admin » Tue Oct 14, 2008 12:25 pm

Hello,

I'd just create a new header for use on the checkout page without the cart total, it's redundant and trying to get it to work with the ajax enabled one page checkout is likely more work than it's worth.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

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

Re: custom Cart Total in Header is incorrect--Need help

Post by jmestep » Tue Oct 14, 2008 2:41 pm

Able uses numbers less than 0 for things like coupons, shipping, taxes. Try filtering your quantity count to exclude basket products that have a productid <0 .
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

vijjendra
Ensign (ENS)
Ensign (ENS)
Posts: 4
Joined: Thu Jan 01, 2009 11:00 am
Contact:

Re: custom Cart Total in Header is incorrect--Need help

Post by vijjendra » Thu Jan 01, 2009 11:07 am

To display the total quantity or Items plz use the following code..

System.Int32 j;
System.Int32 j;
protected void Page_Load(object sender, EventArgs e)
{
GetBasketItems();
}
private void GetBasketItems()
{
Basket basket = Token.Instance.User.Basket;
//WE WANT TO RESET THE GIFT OPTIONS AT THIS STAGE
basket.Package(true);

foreach (BasketItem item in basket.Items)
{
if (item != null)
{
Product product = item.Product;
if (product != null)
{
i++; // total items in the cart
j = j+item.Quantity; // total items Quantity in the cart
}
}
}
MessageItem.Text = Convert.ToString(i);
MessageQuantity.Text = Convert.ToString(j);
}
Vijendra Singh Shakya

Post Reply