Post by sferris » Thu Oct 18, 2012 3:27 am

Hi. I've been searching the forums, but can't quite find a solution to this. I want to show the affiliate's name and info in the header of the cart. How do I access those variables?

Thanks in advance!

New member

Posts

Joined
Sat Jul 16, 2011 12:46 am

Post by ocmta » Thu Oct 18, 2012 3:44 am

In controller:

Code: Select all

$this->load->model('affiliate/affiliate');		
if(isset($this->request->cookie['tracking'])) {
    $affiliate_info = $this->model_affiliate_affiliate->getAffiliateByCode($this->request->cookie['tracking']);
    //now you can use whatever fields you want, e.g.:
    //firstname, lastname, email, telephone, fax, company, website, address_1, address_2, city etc.
   $this->data['affiliate_firstname'] = $affiliate_info['firstname'];
   $this->data['affiliate_lastname'] = $affiliate_info['lastname'];
   //now use it in template as $affiliate_firstname , $affiliate_lastname etc.
} else {
   $this->data['affiliate_firstname'] = '';
   $this->data['affiliate_lastname'] = '';
}

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by sferris » Thu Oct 18, 2012 4:31 am

Perfect! Thanks so much!

New member

Posts

Joined
Sat Jul 16, 2011 12:46 am

Post by sferris » Sat Oct 20, 2012 2:34 am

Another question that's sort of related. I'm testing a few different affiliates, but the first one I put in is the only one associating with orders. How can I get it to change affiliates?

New member

Posts

Joined
Sat Jul 16, 2011 12:46 am

Post by ocmta » Sat Oct 20, 2012 2:59 am

sferris wrote:Another question that's sort of related. I'm testing a few different affiliates, but the first one I put in is the only one associating with orders. How can I get it to change affiliates?
Not 100% sure what you mean, but i feel it's related to the discussion here . While testing you might just try clearing your cookies every time.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by vincent_angbt » Sat Feb 20, 2016 9:27 pm

how about the version 2.1.2 ???

New member

Posts

Joined
Tue Dec 17, 2013 11:35 am
Who is online

Users browsing this forum: Semrush [Bot] and 19 guests