Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › eStore – Loading function "wp_aff_set_affiliate_id_form()" behind the scenes
- This topic has 2 replies, 2 voices, and was last updated 12 years, 6 months ago by halmobi.
-
AuthorPosts
-
May 4, 2012 at 1:13 am #6234halmobiSpectator
Hello,
We are using eStore, eMember and the Affiliate Platform, all recent builds.
I got the new build of wp-affiliate-platform v5.1.4 this morning, for the great new shortcode feature [wp_aff_set_affiliate_id].
What I would really like to be able to do is load the affiliate_id that appears in the shortcode with wp_wp_eStore_coupon_tbl.coupon_code behind the scenes.
We have created our own custom coupon codes and stored them in a new column in the wp_wp_eStore_coupon_tbl as ‘my_coupon_code’. We issue these coupons, and new buyers enter them during checkout in the “Enter Coupon Code:” box in the shopping cart. The discount is successfully applied, the rest of the sales cycle works great. Now we need to reward affiliates who give out these unique codes that have a one to one relationship with their affiliate ID.
If our homework is correct, then we need to understand how to modify the code in estore_cart.php in the function eStore_cart_display_enter_coupon_part(). The steps as I see it would be:
a) Select coupon_code from wp_wp_eStore_coupon_tbl.coupon_code where my_coupon_code = (the value entered in the field .ESTORE_ENTER_COUPON_CODE. of eStore_cart_display_enter_coupon_part())
b) load the affiliate id in [wp_aff_set_affiliate_id] with the returned value from the SELECT. Maybe this can be a type=”hidden” input?
c) Hopefully this would trigger the commission award process for the affiliate as if the new buyer had entered the affiliate ID (coupon_code) directly in the form.
Any help you can provide is greatly appreciated, please let me know if you require any additional info.
Thanking you in advance,
Peter
May 4, 2012 at 6:55 am #44737adminKeymasterIf you are using eStore then a better alternative is probably to use the feature eStore offers under the following settings section:
WP eStore Settings -> AddOn Settings -> Allow Affiliate ID Entry
WP eStore Settings -> AddOn Settings -> Link Affiliate ID with Coupons TableRead the help text for those options and it will explain what they do.
May 6, 2012 at 2:11 pm #44738halmobiSpectatorThank you so much for your fast and accurate response! We have followed through and were able to successfully get the functionality that we needed.
These are really great plugins, and you have terrific support. Truly top-notch and totally appreciated!
Cheers
Peter
-
AuthorPosts
- You must be logged in to reply to this topic.