Ejemplo n.º 1
0
 function test_get_affiliate_referral_count()
 {
     $this->assertEquals(0, affwp_get_affiliate_referral_count($this->_affiliate_id));
 }
/**
 * Decreases an affiliate's total paid referrals by 1
 *
 * @since 1.0
 * @return float|bool
 */
function affwp_decrease_affiliate_referral_count($affiliate_id = 0)
{
    if (empty($affiliate_id)) {
        return false;
    }
    $referrals = affwp_get_affiliate_referral_count($affiliate_id);
    $referrals -= 1;
    if ($referrals < 0) {
        $referrals = 0;
    }
    if (affiliate_wp()->affiliates->update($affiliate_id, array('referrals' => $referrals), '', 'affiliate')) {
        return $referrals;
    } else {
        return false;
    }
}
Ejemplo n.º 3
0
		</thead>

		<tbody>

			<tr>
				<td><?php 
echo affwp_currency_filter(affwp_get_affiliate_earnings($affiliate_id));
?>
</td>
				<td><?php 
echo affwp_get_affiliate_unpaid_earnings($affiliate_id, true);
?>
</td>
				<td><?php 
echo affwp_get_affiliate_referral_count($affiliate_id);
?>
</td>
				<td><?php 
echo affiliate_wp()->referrals->count(array('affiliate_id' => $affiliate_id, 'status' => 'unpaid'));
?>
</td>
				<td><?php 
echo affiliate_wp()->referrals->count(array('affiliate_id' => $affiliate_id, 'status' => 'pending'));
?>
</td>
				<td><?php 
echo affiliate_wp()->referrals->count(array('affiliate_id' => $affiliate_id, 'status' => 'rejected'));
?>
</td>
				<td><?php