Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 4.x > Installation and deployment > check shopping basket for discount View modes: 
User avatar
Member
Member
philip-mosquitodigital.co - 5/12/2011 4:54:52 AM
   
check shopping basket for discount
hi i have amended the custom ecommerce provider to create a .csv of every transaction that goes through the site. this csv then goes into our accounting system. i have been made aware that the system has failed when orders have gone in with discounts applied. so i need to do a check to see if a discount is in the basket:

foreach (CMS.Ecommerce.ShoppingCartItemInfo cartItem in cart.CartItems)
{
//how can i check if this is a discount?????
if (!((ShoppingCartItemInfo)cartItem) == discount)
{
}
}
thanks for any help!

phil

User avatar
Member
Member
philip-mosquitodigital.co - 5/12/2011 9:47:06 AM
   
RE:check shopping basket for discount
done. first i checked to see if the cart item was a product option
if (cartItem.IsProductOption)
that way i know its not a discount.

then i could get the discount coupon if one had been used and applied it to my unitprices.

if (cart.DiscountCouponInfoObj != null)
DiscountValue = cart.DiscountCouponInfoObj.DiscountCouponValue.ToString();