Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 8 of 8

Thread: recurring coupon codes

  1. #1
    Hank is offline Member
    Join Date
    Nov 2007
    Posts
    42

    Default recurring coupon codes

    Is there a way to have coupon codes stay in effect on recurring orders?

    If a customer purchases a recurring product using a coupon code we need for the recurring orders to also use the same coupon code.

    How can I do this?

  2. #2
    John Reasons is offline Senior Member
    Join Date
    Oct 2009
    Posts
    119

    Default

    This would require some customization to get to work the way you want.

    By design the coupon only applies to an order and by design recurring orders makes sure that the price being charged is current for the product, so the discount will not apply to the additional recurring charges only the initial one.

  3. #3
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    There are two parts to this actually:

    a) Coupon Validity: just set the expiration date on the coupon some way out in the future so it's always valid...when the recurring order fires, it could use it again.

    but

    b) at this time, we don't automatically re-enter the prior coupon (that's a bit unusual scenario) on the recurring orders, so you would have to do some mods for that part (not hard I think).
    AspDotNetStorefront
    Shopping Cart

  4. #4
    Hank is offline Member
    Join Date
    Nov 2007
    Posts
    42

    Default

    Thanks. That's what I needed to know.

  5. #5
    usascholar is offline Member
    Join Date
    Jan 2010
    Posts
    64

    Default

    What is the point of having the "Special Offer/Coupon Code" when you create a customer?

    Will the coupon be used on all of the customer's orders... including recurring?

    Thanks
    A

  6. #6
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    It could potentially attract sales. Coupon is used to give customers' a discount, that's the mere purpose of it. You can set that up depending on these coupon attributes.

    Name:  Untitled.jpg
Views: 70
Size:  27.3 KB

  7. #7
    usascholar is offline Member
    Join Date
    Jan 2010
    Posts
    64

    Question

    I understand, however once the coupon is used once... it get's deleted from the customer's record.

    Since I am not looking to change the code and want to continue providing our recurring customers the coupon discount, I use the following stored proc to update the customer records before I charge the day's recurring orders:

    C#/VB.NET Code:
    Create Procedure [dbo].[zpUpdateCustomerCouponCodes]
    as
    update Customer
    set Customer
    .Couponcode c1.CouponCode
    From Customer inner join 
    (Select cu.CustomerIDcu.CouponCode from CouponUsage cu
    inner join 
    (Select CustomerIDMax(CreatedOn) as LastDate
    from CouponUsage group by CustomerID

    on cu
    .CustomerIDg.CustomerID and 
    cu.CreatedOn g.LastDatec1
    on customer
    .CustomerID c1.CustomerID 
    My questions:

    1- How can I prevent the coupons fro being deleted automatically after a charge from the customer record? (I wish you guys used stored procs more, as the presentation layer and business logic should really be separate... just my personal gripe about ADNSF's architecture...)

    2- Is there a stored proc that get's activated before or after a charge is done? Maybe I can add my cheesy proc to it on the backend so I can be completely be hands off when this happens.


    thanks

  8. #8
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    We used tons of them, indeed. If you can just go to your sql manager, and navigate to Programmability -> Stored Proc. There are tons of them there we used throughout the codes (xmlpackages, classes, etc).

    You could set ClearCouponAfterOrdering to false so the customer coupon code will remain active in their customer record.