WordPress Affiliate Manager

Affiliates Management Plugin for WordPress

  • Home
  • Features
    • Screen Shots
  • Download
  • Documentation
  • Addons
  • Support
    • Support Forum
    • Forum Login
    • Forum Registration
    • Contact
    • Premium Addon/Plugin Support

[Support request] Hook After Purchase

by

WordPress Affiliate Manager › Forums › Affiliate Manager Plugin › Hook After Purchase

Tagged: alert, notify, purchase

This topic contains 3 replies, has 2 voices, and was last updated by  Shadow Labs 4 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 23, 2019 at 8:49 pm #4805

    squiggie
    Participant

    I’d like to develop a way where I could notify users of a twitch stream when an affiliate purchase happens. Is there a way to do this? Is there an api endpoint that could be monitored or hook that could be fired to throw an alert within streamlabs that would allow this to happen.

    I’m mainly looking for a way to throw an alert when an affiliate purchase happens.

    Frankly I’m not even sure how to go about starting this but looking for ideas on how to get this to happen.

    July 24, 2019 at 4:24 am #4806

    Shadow Labs
    Keymaster

    @squiggie, We do have an action hook that can be triggered to reward a commission to an affiliate: https://wpaffiliatemanager.com/api-track-commission-via-a-wordpress-hook/

    July 24, 2019 at 1:45 pm #4807

    squiggie
    Participant

    I’m struggling to see how this all might tie together. Can you help me visualize the process or walk through the process?

    A custom wordpress plugin/app allows affiliates to OAuth to the StreamLabs API and stores their access token and twitch username in the WordPress DB
    A Custom Field on the affiliate registration page would allow an affiliate to enter their Twitch Username thus allowing us to associate that twitch username with the access token granted above. I’m assuming these custom fields are stored in the wordpress database right?
    —
    A user comes to the site based on an affiliate link
    They purchase a product
    The do_action(‘wpam_process_affiliate_commission’, $args); is triggered
    I get the affiliate id by getting it from the cookie $aff_id = $_COOKIE[‘wpam_id’];
    With the affiliate_id, I query the custom fields to get the access to twitch username above
    With the twitch username, I query the db to get the Streamlabs access token
    With the token, I send a request to the StreamLabs api with the Alert Box Information

    Does this make sense? Are my assumptions about the Custom Affiliate Fields correct and are they stored in the DB?

    July 25, 2019 at 5:30 am #4809

    Shadow Labs
    Keymaster

    @squiggie, It should work since the custom field value is saved in the database.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Featured Addons

  • WooCommerce Coupon Tracking
  • WooCommerce Product Specific Commission

Copyright © 2019 | WordPress Affiliate Manager | Privacy Policy