Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › WP Affiliate Tweaks › Affiliate Statistics Modification
- This topic has 3 replies, 2 voices, and was last updated 10 years, 6 months ago by BookBiz.
-
AuthorPosts
-
May 17, 2014 at 11:04 pm #10850BookBizSpectator
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 #63063adminKeymasterYeah that sounds like a good idea. I will look into making this change.
May 18, 2014 at 7:32 pm #63064BookBizSpectatorFor 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 #63065BookBizSpectator#3 should read “FIND the following code (Lines 139)”
There is nothing to comment out in that step … only find/replace
-
AuthorPosts
- You must be logged in to reply to this topic.