
Originally Posted by
picandnix
A possible bug?
once the commission is marked as 'paid' by store admin the affiliate receives an email stating the commission earnings. However in my live test site the email received states my affiliate has received $0.00 even though admin shows that they have been paid $1.00.
An absolute bug, darn it! Make this change, starting at line 208 of /YOUR_ADMIN/referrers.php:
Code:
case 'pay':
$query = "UPDATE " . TABLE_COMMISSION . " SET commission_paid = NOW() WHERE commission_paid = '0000-00-00 00:00:00' AND commission_referrer_key = '" . $referrers[$selected]['referrer_key'] . "'";
$result = $db->Execute($query);
$now = date("Y-m-d H:i:s", time());
$commission_paid = $referrers[$selected]['orders_unpaid']; /*v2.0.1a*/
$referrers[$selected]['orders_unpaid'] = 0;
for ($i = 0, $n = count($referrers[$selected]['orders']); $i < $n; $i++) {
if ($referrers[$selected]['orders'][$i]['commission_paid'] == '0000-00-00 00:00:00') {
$referrers[$selected]['orders'][$i]['commission_paid'] = $now;
}
}
send_notification_email (
$referrers[$selected],
EMAIL_SUBJECT_PAID,
sprintf(EMAIL_MESSAGE_PAID_TEXT, $currencies->format(floatval($commission_paid)), zen_catalog_href_link(FILENAME_LOGIN, '', 'SSL'), zen_catalog_href_link(FILENAME_REFERRER_MAIN, '', 'SSL'), zen_catalog_href_link(FILENAME_CONTACT_US, '', 'NONSSL')),
sprintf(EMAIL_MESSAGE_PAID_HTML, $currencies->format(floatval($commission_paid)), zen_catalog_href_link(FILENAME_LOGIN, '', 'SSL'), zen_catalog_href_link(FILENAME_REFERRER_MAIN, '', 'SSL'), zen_catalog_href_link(FILENAME_CONTACT_US, '', 'NONSSL'))); /*v2.0.1c*/
break;
But wait ... there's more!
Update /YOUR_ADMIN/extra_datafiles/referrers_filenames.php:
Code:
<?php
/*
** Database tables and filenames associated with the Snap Affiliates v2.0 plugin.
**
** NOTE: Admin-side definitions!
*/
define('TABLE_REFERRERS', DB_PREFIX . 'referrers');
define('TABLE_COMMISSION', DB_PREFIX . 'commission');
define('FILENAME_REFERRERS', 'referrers');
define('FILENAME_REFERRER_MAIN', 'referrer_main'); /*v2.0.1a*/
and make the following change starting at line 82 of /YOUR_ADMIN/languages/english/referrers.php:
Code:
define('EMAIL_MESSAGE_PAID_HTML', 'A commission payment was recently made for your ' . STORE_NAME . ' referral account. Your total earnings this period were <strong>%1$s</strong>.<br /><br />To view your complete order history, you can login (<a href="%2$s">%2$s</a>) and view your referrer statistics (<a href="%3$s">%3$s</a>). If you have any questions, don\'t hesitate to contact us: <a href="%4$s">%4$s</a>.<br /><br />Sincerely,<br /><br />' . STORE_OWNER); /*v2.0.1c*/
define('EMAIL_MESSAGE_PAID_TEXT', 'A commission payment was recently made for your ' . STORE_NAME . ' referral account. Your total earnings this period were %1$s.' . "\n\n" . 'To view your complete order history, you can login (%2$s) and view your referrer statistics (%3$s). If you have any questions, don\'t hesitate to contact us using this link: %4$s.' . "\n\nSincerely,\n\n" . STORE_OWNER); /*v2.0.1c*/
Bookmarks