Post by AndreaW » Fri Oct 07, 2011 11:09 pm

The affiliate program is good - very simple. But the only issue is it links to single "products" and there does not seem to be an option that could take people to the Home Page first, so that someone can read the sales letter and choose what product they want. Any thoughts or help as to how to do this?

Newbie

Posts

Joined
Fri Oct 07, 2011 11:05 pm

Post by uksitebuilder » Sat Oct 08, 2011 1:01 am

Affiliates tracking code will be picked up wherever they land on your site, so going to www.yoursite.com/?tracking=99999 (your home page) will set a cookie and track whatever they buy

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by AndreaW » Sat Oct 08, 2011 2:07 am

Hi Simon, thanks for the reply. Not sure what you mean though. The affiliate program only allows you to type in a product and then generates the link that goes to that products 'buy page' rather than the home page.

Newbie

Posts

Joined
Fri Oct 07, 2011 11:05 pm

Post by uksitebuilder » Sat Oct 08, 2011 2:20 am

But you could edit the template file and put the home page link in too

That way they can share your home page and get commission from any products purchased

open: catalog/controller/affiliate/tracking.php
find

Code: Select all

		$this->data['text_code'] = $this->language->get('text_code');
add after

Code: Select all

		$this->data['text_homelink'] = $this->language->get('text_homelink');
find

Code: Select all

    	$this->data['code'] = $this->affiliate->getCode();
add after

Code: Select all

    	$this->data['homelink'] = str_replace('&', '&', $this->url->link('common/home', 'product_id=' . $result['product_id'] . '&tracking=' . $this->affiliate->getCode()

open: catalog/view/theme/default/template/affiliate/tracking.tpl
find

Code: Select all

  <p><?php echo $text_code; ?><br />
    <textarea cols="40" rows="5"><?php echo $code; ?></textarea>
  </p>
add after

Code: Select all

  <p><?php echo $text_homelink; ?><br />
    <textarea cols="40" rows="5"><?php echo $homelink; ?></textarea>
  </p>
open: catalog/language/english/affiliate/tracking.php

find

Code: Select all

$_['text_code']        = '<b>Your Tracking Code:</b>';
add after

Code: Select all

$_['text_homelink']        = '<b>Homepage Link With Your Tracking Code:</b>';

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by spitos » Thu Oct 20, 2011 10:13 pm

uksitebuilder wrote:But you could edit the template file and put the home page link in too

That way they can share your home page and get commission from any products purchased

find

Code: Select all

    	$this->data['code'] = $this->affiliate->getCode();
add after

Code: Select all

    	$this->data['homelink'] = str_replace('&', '&', $this->url->link('common/home', 'product_id=' . $result['product_id'] . '&tracking=' . $this->affiliate->getCode()

This seems to be incorrect and resulted in an error on the site.

Adding this instead seems to work:

Code: Select all

$this->data['homelink'] = str_replace('&', '&', $this->url->link('common/home', '&tracking=' . $this->affiliate->getCode()));

Image
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here


User avatar
Active Member

Posts

Joined
Mon May 23, 2011 6:19 pm
Location - UK

Post by AndreaW » Mon Oct 24, 2011 4:33 am

Thanks!

Newbie

Posts

Joined
Fri Oct 07, 2011 11:05 pm

Post by kim.portrait » Tue Nov 15, 2011 11:05 pm

Wow! Thanks :-)
Links from individual products do seem to work for the whole site just fine, but offering a homepage affiliate link too is rather logical.

Does anyone know if there is a time limit on affiliate links? Or how to set this up?

User avatar
Newbie

Posts

Joined
Tue Feb 22, 2011 7:00 pm

Post by ddac84 » Thu Aug 02, 2018 7:15 pm

I know this is an old post, but any idea how to do this on OC3?

Newbie

Posts

Joined
Wed Nov 30, 2016 9:16 pm

Post by straightlight » Thu Aug 02, 2018 8:03 pm

ddac84 wrote:
Thu Aug 02, 2018 7:15 pm
I know this is an old post, but any idea how to do this on OC3?
In catalog/controller/account/tracking.php file,

find:

Code: Select all

$data['code'] = $affiliate_info['tracking'];
add below:

Code: Select all

$data['homelink'] = str_replace('&amp;', '&', $this->url->link('common/home', 'tracking=' . $affiliate_info['tracking'], true));
Then, in catalog/language/<your_lang_code>/account/tracking.php file, add at the bottom:

Code: Select all

$_['entry_homelink']        = '<b>Homepage Link With Your Tracking Code:</b>';
Then, in catalog/view/theme/<your_theme>/template/account/tracking.twig file,

find:

Code: Select all

<div class="form-group">
          <label class="col-sm-2 control-label" for="input-code">{{ entry_code }}</label>
          <div class="col-sm-10">
            <textarea cols="40" rows="5" placeholder="{{ entry_code }}" id="input-code" class="form-control">{{ code }}</textarea>
          </div>
        </div>
add below:

Code: Select all

{% if homelink %}
<div class="form-group">
          <label class="col-sm-2 control-label" for="input-code">{{ entry_homelink }}</label>
          <div class="col-sm-10">
            <textarea cols="40" rows="5" placeholder="{{ entry_homelink }}" id="input-code" class="form-control">{{ homelink }}</textarea>
          </div>
        </div>
{% endif %} 
This should resolved the issue.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ddac84 » Fri Aug 03, 2018 9:07 pm

;D ;D ;D Thank you so so much! You are an absolute star! :yahoo: :banana:

Newbie

Posts

Joined
Wed Nov 30, 2016 9:16 pm
Who is online

Users browsing this forum: No registered users and 26 guests