Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
What's the best way to get the current basket total item programatically ?
Thank You
Feri
SiteContext.Current.OrderContext.GetBasket().PurhcaseOrder.OrderTotal
Make sure that you've executed the basket pipeline at least once to have the latest value reflected in the total fields.
Hi Soren,
Thanks for the reply, But the OrderTotal properties is the dollar value of the order. Is there away we know the number of item/s in the basket?
Thanks You
Hm, do you mean something like purchase.OrderLines.Count() (number of different items in basket)?
Or do you want the total of all item quantities? This should work like this: int total = purchaseOrder.OrderLines.Sum(ol => ol.Quantity);
bye
Christian
Perfect!!
Thank You Christian.
If my question is confusing. I am sorry. :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Current basket total item?
What's the best way to get the current basket total item programatically ?
Thank You
Feri
Make sure that you've executed the basket pipeline at least once to have the latest value reflected in the total fields.
Hi Soren,
Thanks for the reply, But the OrderTotal properties is the dollar value of the order. Is there away we know the number of item/s in the basket?
Thanks You
Feri
Hm, do you mean something like purchase.OrderLines.Count() (number of different items in basket)?
Or do you want the total of all item quantities? This should work like this: int total = purchaseOrder.OrderLines.Sum(ol => ol.Quantity);
bye
Christian
Perfect!!
Thank You Christian.
If my question is confusing. I am sorry. :)
Feri
is working on a reply...