Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › eStore coupon for use with aweber opt in form
- This topic has 5 replies, 3 voices, and was last updated 11 years, 5 months ago by Robert.
-
AuthorPosts
-
June 10, 2013 at 9:31 pm #9193RobertParticipant
This may be a bit technical, but I believe it is very possible and useful. I have an aweber opt-in form that currently includes a field that is dynamically created (via javascript) for a coupon. That field is then used in the autoresponder to tell the person who opted in “Hey here is a coupon for $10 you can use in my store when you spend $20, and you got it just for joining my list”.
I get notified when people sign up and then I manually enter this code into eStore.
What I’d like to be able to do is have the whole thing automated so I don’t have to manually enter the coupon. Basically when someone opts in it would first create the coupon code, add it in eStore, then continue on to aweber.
I can create the coupon first in javascript, then go to php or have php create the coupon and tell javascript, don’t really care.
Any chance of adding this functionality or at least pointing me in the right direction to making it happen myself?
Thanks…love the products by the way (and all the help I’ve been given).
Robert
June 11, 2013 at 12:28 am #56052KeithMemberHi Robert,
Someone else may have a better solution, but there is a Dynamic Coupon Addon for WP eStore that may provide as a good starting point for what you are trying to accomplish.
It’s available here: http://www.tipsandtricks-hq.com/ecommerce/wp-estore-dynamic-couponsdiscounts-addon-2220
Obviously you’ll need some PHP skills but I thought it a good starting point until a better solution arrives (or in case one doesn’t).
June 11, 2013 at 3:49 pm #56053RobertParticipantThanks Keith. I did see that and have d/l it to take a look. Still hoping for a better solution though.
Thanks again,
Robert
June 12, 2013 at 3:36 am #56054RobertParticipantI’ve been thinking about this…seems to me that I should be able to call the code that fires the dynamic coupon via javascript, then return that code and then send it to aweber.
Just need to know what php function I should call via javascript to start the process (and how to return the generated code).
Thanks,
Robert
June 12, 2013 at 5:43 am #56055adminKeymasterHi Robert, You probably want to call the PHP function from JavaScript using AJAX. The question is how comfortable you are with doing AJAX queries.
Here is a rough workflow:
1) Your javascript code fires an ajax query to a PHP script on the server
2) This php script can call any required PHP function and do whatever it needs to do on the server
3) The script then returns a string back to your JavaScript code (this happens part of the AJAX query)
4) Your javascript code can do whatever it wants to do with that string it received back from the server.
June 12, 2013 at 5:54 pm #56056RobertParticipantThanks for the reply…I was up all night researching and came to that exact conclusion. Took a while to get the AJAX part, but finally got it. I created my own php file calling the plugin db functions. Works like a charm.
Robert
-
AuthorPosts
- You must be logged in to reply to this topic.