Tracker issue Bug

jmagne
jmagne
Offline
0
You have a bug in the Affiliate tracker system plugin.

When the plugin is trying to find a proper affiliate to assign, it searches for atid value first
If not found, searches with the affiliate referral word
And finally for the http_referrer.

That last search does not filter on affiliates that are published like the other 2. So even if you unpublish the affiliate, sales may still be assigned to him.

old code:
					$query = $db->getQuery(true);
$query->select($db->quoteName('id'))
->from($db->quoteName('#__affiliate_tracker_accounts'))
->where($db->quoteName('refer_url') . ' LIKE '. $db->quote($db->escape('%'.parse_url($realRefer, PHP_URL_HOST).'%')))
->where($db->quoteName('publish') . ' = ' . $db->quote(1));
$db->setQuery($query);


new code:
					$query = $db->getQuery(true);
$query->select($db->quoteName('id'))
->from($db->quoteName('#__affiliate_tracker_accounts'))
->where($db->quoteName('refer_url') . ' LIKE '. $db->quote($db->escape('%'.parse_url($realRefer, PHP_URL_HOST).'%')))
->where($db->quoteName('publish') . ' = ' . $db->quote(1));
$db->setQuery($query);
Responses (1)
  • Accepted Answer

    Sunday, April 15 2018, 10:04 AM - #Permalink
    0
    thanks, I'll take a look at this.
    The reply is currently minimized Show
Your Reply