coupon code for tracking

We've created a coupon code that doesn't actually provide any discount, but will rather be used for tracking purposes so that gifts can be matched after the fact for anyone who has used the code in their purchase. However, it appears that if there is no discount applied, the coupon code is not passed along with the transaction data. Is there any way that I can modify this so that we can still see coupon codes added to a transaction even if there is no discount applied?

I can whisper specific transaction id information.
  • fc_adamfc_adam FoxyCart Team

    Good question. Currently a coupon needs to provide some form of discount in order to be counted against the transaction. You can set it to just discount 1¢, but it needs to be at least that to be connected with the purchase in the admin.
  • Ok, thanks. Am I right to think I could add a custom session variable, h:, to track orders? And I could trigger this on a coupon add?
  • fc_adamfc_adam FoxyCart Team
    edited November 2015

    You could definitely approach it that way. You could hook into the coupon add and remove events to toggle the session variable as needed. As a safeguard - you could also add one to the checkout submit event which pauses that event to ensure the session variable is there (or isn't there) as needed.
Sign In or Register to comment.