I am looking to add a tiered coupon to our website (i.e. $5 off $25+, $10 off $50+...). I have added a field to the coupon table that is "CouponTiered". This is a 1 or 0 field. In coupons.cs I added the following:
public class CouponObject
Code:
internal bool m_coupontiered = false;
public List<CouponObject> InitCoupon
Code:
co.m_coupontiered = DB.RSFieldBool(rs, "CouponTiered");
Code:
public bool CouponTiered
{
get { return m_coupontiered; }
}
public static CouponObject GetCoupon()
Code:
co.m_coupontiered = DB.RSFieldBool(rscoup, "CouponTiered");
public static String CheckIfCouponIsValidForOrder()
Code:
if (status == AppLogic.ro_OK)
{
if (co.m_coupontiered && st < 25)
{
status = String.Format(AppLogic.GetString("shoppingcart.cs.73", ThisCustomer.SkinID, ThisCustomer.LocaleSetting), ThisCustomer.CurrencyString(25));
}
// If we get here, we need to change the discount amount to match the tiered pricing
else
{
if (co.m_coupontiered && st >= 25)
{
if (st >= 25 && st < 50) // $5 off $25+
{
co.m_discountamount = 5;
co.m_description = "$5 off $25+";
}
else if (st >= 50 && st < 100) // $10 off $50+
{
co.m_discountamount = 10;
co.m_description = "$10 off $50+";
}
else if (st >= 100) // $20 off $100+
{
co.m_discountamount = 20;
co.m_description = "$20 off $100+";
}
}
}
}
With this code, I can type the coupon code in on shoppingcart.aspx and click the update button to the right, and it will show the $X off $X+ but I have to push the update button again for it to reflect in the subtotal. Any ideas why this is or if there is a better way to do this?