Needs work
Project:
Ubercart Affiliate v2
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 May 2010 at 18:00 UTC
Updated:
31 Oct 2011 at 13:02 UTC
The built-in subdomain management in UC Affiliate didn't work for me, as it conflicts with "any other module that manages subdomains" (from documentation). Got the infinite redirect loop issue described in another thread.
This short function can be placed into a module to work in conjunction with Domain User; when a user's domain is hit, we set the affiliate cookie. Not sure if this should be merged with UC Affiliate2, Domain User, or it's own standalone glue module...
function domain_user_x_affiliate2_init() {
$domain = domain_get_domain();
if(isset($domain['uid']) && $domain['uid'] > 0) {
$account = user_load(array('uid' => $domain['uid']));
_uc_affiliate2_clicked($account, $_GET['q']); // no need for check_access as _u_a_c function does this for us.
}
}
Comments
Comment #1
bojanz commentedIn this form, it doesn't belong in uc_affiliate2.
Maybe in a better form (where it checks if that module is enabed and provides integration..)
Comment #2
CHI.seo2design.com commentedDoes it working for you?
I created a module use your code above, but it not work for me just as my want.