validating coupons for new customers only?

We would like to offer a coupon-based promotion that is available to new customers only. I know that it is technically possible set up a custom validation at checkout that checks the customer's order count, but I am not sure how to make that interface with coupons, which are applied in the cart. Is there a way that we could set up a checkout validation that runs if a "new customer" coupon is used, and then if the validation returns negative results (a current customer) it would automatically remove the coupon and give them an opportunity to checkout again without it? Thanks for your help.

Geoffrey
Comments
  • brettbrett FoxyCart Team
    edited February 2015
    Good news, @Geoffrey!
    http://www.foxycart.com/blog/coupon-improvements-product-specific-and-per-customer-usage-control

    2.0 allows you to limit coupon usage by customer, so once a customer has used the coupon, they can't use it again. When the customer puts their password in, they'll see this: http://note.io/1ARZvtY

    That what you're after?
  • Hi Brett. Thanks the for the reply. The new function you refer to is helpful, but not exactly what I'm looking for. This would still allow current customers one opportunity to use any new coupon set up this way. I am interested in allowing ONLY completely new customers to use the coupon (as in customer_order_count == 0). Does that make sense?
  • fc_adamfc_adam FoxyCart Team
    @Geoffrey,

    So we don't have a way to do that natively - but there could be a work-around that you could set it up on your side, depending on your requirements.

    If you force users to create accounts and don't allow guests - you could add some custom javascript to your checkout that if the customer logs in, and has that coupon present on their cart, remove the coupon using a JSONP request.

    If you do allow guests - it's still possible but requires a bit more work - you'd need to perform an API request to find any previous orders for a given customers email address. To do that you'd set up a script on your own server and perform an ajax request over HTTPS to that page, perform the API call and return the result.

    Combining that with the feature Brett mentioned in 2.0 - that should get you what you're after.
Sign In or Register to comment.