Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Affiliate Statistics Modification

by

Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › WP Affiliate Tweaks › Affiliate Statistics Modification

Tagged: Affiliate Commission, Affiliate platform, statistics view

  • This topic has 3 replies, 2 voices, and was last updated 11 years ago by BookBiz.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • May 17, 2014 at 11:04 pm #10850
    BookBiz
    Spectator

    It would be helpful if the Affiliate’s Stats view could be modified to only provide data for the products/services for which the affiliate is compensated.

    For example, on one of my websites, I only pay commissions on a few of the products we offer. The rest of the products have a commission of ‘0’. For some products/services, the cost structure does not permit a commission to be paid. When an affiliate generates a sale of a non-commission product, they see it in their stats – Number of Sales & Total Sales Amount.

    While our Affiliate Center clearly states which products they can earn commissions on, the Stats area still leads to a number of unnecessary conversations. Is it possible to change this section to only display a total when the product’s commission is not ‘0’?

    May 18, 2014 at 5:15 am #63063
    admin
    Keymaster

    Yeah that sounds like a good idea. I will look into making this change.

    May 18, 2014 at 7:32 pm #63064
    BookBiz
    Spectator

    For two of my sites, I had hacked together the following solution that adjusts the number of sales and removes the total sales amount. I suspect you’ll want to do something a bit more comprehensive. However, I thought I’d post it in case it helps expedite your modification, or if someone else wants a quick fix:

    File – members_only_view.php

    Line – 99

    1) FIND the following code:


    $query = $wpdb->get_row(“SELECT count(*) as total_record FROM $sales_table WHERE payment > 0 AND refid = ‘”.$_SESSION.”‘ AND date BETWEEN ‘$start_date’ AND ‘$end_date'”, OBJECT);

    $number_of_sales = $query->total_record;

    if (empty($number_of_sales)){

    $number_of_sales = “0”;

    }


    2) REPLACE with the following code


    $query = $wpdb->get_row(“SELECT count(*) as total_record FROM $sales_table WHERE payment > 0 AND refid = ‘”.$_SESSION.”‘ AND date BETWEEN ‘$start_date’ AND ‘$end_date'”, OBJECT);

    $refunds = $wpdb->get_row(“SELECT count(*) as total_refunds FROM $sales_table WHERE payment < 0 AND refid = ‘”.$_SESSION.”‘ AND date BETWEEN ‘$start_date’ AND ‘$end_date'”, OBJECT);

    $number_of_sales = $query->total_record;

    $number_of_refunds = $refunds->total_refunds;

    $net_sales = $number_of_sales – $number_of_refunds;

    if (empty($net_sales))

    {

    $net_sales = “0”;

    }


    3) FIND the following code and comment it out (Lines 139)


    FIND $number_of_sales

    REPLACE with $net_sales


    4) FIND the following code and comment it out (Lines 144 – 147)


    // echo ‘<td>‘.AFF_TOTAL_SALES_AMOUNT.’ : </td>’;

    // echo ‘<td>’.$total_sales.'</td>’;

    // echo ‘<td>’.$currency.'</td>’;


    May 19, 2014 at 10:48 am #63065
    BookBiz
    Spectator

    #3 should read “FIND the following code (Lines 139)”

    There is nothing to comment out in that step … only find/replace

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

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ