Hello Todd,
Using the Discount coupon indeed sounds like the easiest approach in this case. The shopping cart is created any time a new visitor arrives at the site. CMS.Ecommerce.ECommerceContext.CurrentShoppingCart always initializes into an empty shopping cart object whenever it detects it is currently null. This means you can simply add the discount coupon to it via API and it will apply later when the customer adds anything to it:
DiscountCouponInfo coupon = DiscountCouponInfoProvider.GetDiscountCouponInfo("aaCoupon", CurrentSiteName);
if (coupon != null)
{
ECommerceContext.CurrentShoppingCart.ShoppingCartDiscountCouponID = coupon.DiscountCouponID;
}
The only issue you will need to overcome is that Kentico removes the coupon upon login. The coupon code is considered a private information, so Kentico clears it any time the ownership of the shopping cart changes. You can preserve the discount coupon by implementing this Custom Info Provider:
public class CustomShoppingCartInfoProvider : ShoppingCartInfoProvider
{
protected override void ClearShoppingCartPrivateDataInternal(ShoppingCartInfo cartObj)
{
int discountCouponID = (cartObj != null) ? cartObj.ShoppingCartDiscountCouponID : 0;
base.ClearShoppingCartPrivateDataInternal(cartObj);
cartObj.ShoppingCartDiscountCouponID = discountCouponID;
}
}
This however is not an issue if the customer registers during checkout, so you can skip this part if the discount will be available only to a completely new users.