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

Work with Hook API

by

WordPress Affiliate Manager › Forums › Affiliate Manager Plugin › Work with Hook API

Tagged: API, Hook, lead tracking, manual commission

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 1 month ago by Shadow Labs.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 22, 2016 at 9:44 am #1713
    Flowrian2014
    Participant

    Hi,

    i inserted following code on a thank you page to track and pay for leads >>

    $uniqid = uniqid();
    $args = array();
    $args[‘txn_id’] = $uniqid;
    $args[‘amount’] = ‘0.01’;
    $args[‘aff_id’] = $_COOKIE[‘wpam_id’];
    do_action(‘wpam_process_affiliate_commission’, $args);

    But now the commission applies 3 times?

    Please advise, since this would be a really nice feature for your great plugin.

    February 25, 2016 at 10:02 am #1717
    Shadow Labs
    Keymaster

    Hi, That means the code is getting executed three times. This could be resolved if you follow one of these options:

    1) Fix the issue that’s causing your page to load multiple times
    2) Use one simple ID for each submission instead of generating a unique ID before calling the hook. That way if one record is already in the database, multiple insertions with the same ID will fail.

    Usually this type of issue doesn’t happen when the transaction ID comes from the payment gateway. Since you are not really processing any payments, I would recommend that you generate the unique ID beforehand and embed in the form as a hidden input field. When the form is submitted simple read the value of the hidden field (via $_REQUEST) and pass it to the action hook.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Featured Addons

  • WooCommerce Coupon Tracking
  • WooCommerce Product Specific Commission

Copyright © 2026 | WordPress Affiliate Manager | Privacy Policy