Forums / All Other Contributions/Addons / Snap Affiliates v2.0 for v1.5.0 and later

Snap Affiliates v2.0 for v1.5.0 and later

Views: 68,400

Results 81 to 100 of 464
11 Jun 2013, 12:40 PM
#81
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Snap Affiliates v2.0 for v1.5.0 and later

treblesand:

I'm having a small issue that probably has a really easy fix I just can't see... I would love some help if anyone has a moment. I'm running ZC 1.5.0 and Snap Affiliates 2.2.0

I managed to get a few banner images up and displaying for affiliates to use. My issue is that in their code, the path to the image location is a relative path, not the full path, so it does not display in their pages (so it says something like /images/referrers/ref.207.207.jpg instead of http://mysite.com/zencart/images/referrers/ref.207.207.jpg) Is there a way to change this path so it works?

Also, is there a way to choose which page each image points to? So I might have one image point to the main cart page, but another image point to a particular product?

I LOVE this mod, by the way, and I can see how many many hours have gone into it. Thank you, developers, for all the time you've put into it! And thank you in advance for any help you can give me on this :)
Here's a patch to the get_referrer_image function located in /includes/templates/YOUR_TEMPLATE/templates/tpl_referrer_tools_default.php to correct the relative path issue:

function get_referrer_image($width, $height, $filename) {
  $image_html = '';
  $alt = TEXT_IMAGE_ALT_TEXT;
  $filename = HTTP_SERVER . DIR_WS_CATALOG . $filename;  /*v2.3.0a*/
  $image_html .= '<div class="imagewrap">';
  $image_html .= '<div class="imagetitle">' . sprintf(TEXT_X_BY_Y_PIXELS, $width, $height) . '</div>';
  $image_html .= "<img class=\"referrer_image\" src=\"$filename\" width=\"$width\" height=\"$height\" alt=\"$alt\" /><br />";
  $image_html .= '<textarea rows="3" cols="1"><a href="' . get_referrer_link(FILENAME_DEFAULT) . "\"><img src=\"$filename\" width=\"$width\" height=\"$height\" alt=\"$alt\" /></a></textarea><br />";
  $image_html .= '</div>';

  return $image_html;
}

That update will be included in v2.3.0 of the plugin. Choosing the page (and presumedly alt-text) that a particular image references will take a bit of thinking ...

11 Jun 2013, 7:56 PM
#82
treblesand avatar

treblesand

New Zenner

Join Date:
Jun 2012
Posts:
9
Plugin Contributions:
0

Re: Snap Affiliates v2.0 for v1.5.0 and later

Thank you for such a fast response and for fixing this issue for me. Your fix worked like a charm ;) For now, I'll put together a tutorial for my affiliates to teach them how to turn images into direct links to products... I was just hoping there was an easier way to do the work for them and make it easier for them to include their links more often. AWESOME work and thank you so much for the quick fix! :)

11 Jun 2013, 8:27 PM
#83
treblesand avatar

treblesand

New Zenner

Join Date:
Jun 2012
Posts:
9
Plugin Contributions:
0

Re: Snap Affiliates v2.0 for v1.5.0 and later

Is there something I can add easily to allow my affiliates to track the clicks they are generating? It would be fantastic if they could see clicks by link, but even if they can just see that between date x and date y they've seen z number of clicks, that would be great. I could probably work this out on my own with a small idea of where to start... Thanks again for all your help!!

12 Jun 2013, 11:32 AM
#84
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

treblesand:

Is there something I can add easily to allow my affiliates to track the clicks they are generating? It would be fantastic if they could see clicks by link, but even if they can just see that between date x and date y they've seen z number of clicks, that would be great. I could probably work this out on my own with a small idea of where to start... Thanks again for all your help!!
Reading through the thread on this plugin's parent, I generated the following "wish list" from features requested:

  • (2.0.0) Move language-specific constants to language files to allow language translation
  • (2.0.0) Use built-in currency formatting so that the amounts show in the store's default currency
  • (2.1.0) Allow customization to control which order-status values should "trigger" a commission, e.g. no commission on 'Pending' order status.
  • Better email system
  • More detailed application (payment choice)
  • The ability to create an affiliate account without needed a store account.
  • (2.1.0) A configuration switch that identifies whether or not an affiliate gets commission when placing an order with their affiliate key.
  • Commission Rate by category: This will need a code rewrite.
  • Better stats such as Click tracking
  • (2.1.1) SEO Support : Certain SEO modules work with this as is right now. (Like Ultimate SEO's). Others, it's tricky.
  • Ability to edit details in ACP.
  • Ability to deny applications in ACP.
  • Ability to edit details on the customer side. (Some might change websites.)
  • Ability to add "Where to send my check?"
  • (2.2.0) Customization of cookie lifetime
  • Customer Purchases per Cookie - All vs. One

No promises on when these would be implemented, but if current users would "chime in" with their priority order I'd have a better idea of where to focus; at this time I'm handling the low-hanging (i.e. easiest) fruit first!

12 Jun 2013, 12:59 PM
#85
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

I've submitted v2.3.0 to the plugins area:

  1. Starting with this version, there is one core-file overwrite.
  2. Added an Order ID column to the detailed view in the admin's Customers->Referrers page, to allow the store administrator to have an easy way to see the order for which the commission was paid.
  3. Added an indicator to the admin's Customers->Orders page, to allow the store administrator to quickly see that the order was based on a commission. A link-back to the referrer's details is also included
  4. BUGFIX: When using the affiliate banners, the image-link produced was relative instead of absolute so it didn't reference the actual store.
  5. Added "Purchases Per Cookie" configuration variable
12 Jun 2013, 10:43 PM
#86
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Snap Affiliates v2.0 for v1.5.0 and later

Hi there Lat9 :hug:
luvin' the latest editions.
Noticed on the upgrade info data that there's a file path missing, (nit picking I know but somebody is bound to get lost one day)

Files changed:

/includes/classes/observers/class.snap_order_observer.php
/includes/templates/YOUR_TEMPLATE/**templates**/tpl_referrer_tools_default.php
/YOUR_ADMIN/referrers.php
/YOUR_ADMIN/includes/functions/extra_functions/init_referrers.php
/YOUR_ADMIN/includes/languages/english/referrers.php
12 Jun 2013, 11:00 PM
#87
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Snap Affiliates v2.0 for v1.5.0 and later

what has been changed to this file since v2.10 please?
/includes/classes/observers/class.snap_order_observer.php

12 Jun 2013, 11:29 PM
#88
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Snap Affiliates v2.0 for v1.5.0 and later

Yes it's me again...
which file or files are responsible for allowing the affiliate to edit their website details on their affiliate account page please, I can't seem to find it mentioned in the upgrade (2.2>2.3) changed/new files list.

13 Jun 2013, 12:01 PM
#89
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

picandnix:

Hi there Lat9 :hug:
luvin' the latest editions.
Noticed on the upgrade info data that there's a file path missing, (nit picking I know but somebody is bound to get lost one day)

Files changed:

/includes/classes/observers/class.snap_order_observer.php
/includes/templates/YOUR_TEMPLATE/**templates**/tpl_referrer_tools_default.php
/YOUR_ADMIN/referrers.php
/YOUR_ADMIN/includes/functions/extra_functions/init_referrers.php
/YOUR_ADMIN/includes/languages/english/referrers.php

Thanks, picandnix, I'll get that into the updated readme.html.

picandnix:

what has been changed to this file since v2.10 please?
/includes/classes/observers/class.snap_order_observer.php
Er, in my local copy, the support for the purchases-per-cookie; in the distribution, nada.:blink: Here's the file that should be in the v2.3.0 version:

<?php
// +----------------------------------------------------------------------+
// |Snap Affiliates for Zen Cart                                          |
// +----------------------------------------------------------------------+
// | Copyright (c) 2013, Vinos de Frutas Tropicales (lat9) for ZC 1.5.0+  |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license.       |
// +----------------------------------------------------------------------+

if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

class snap_order_observer extends base {

  function snap_order_observer() {
    $this->attach($this, array('NOTIFY_ORDER_DURING_CREATE_ADDED_ORDER_HEADER'));
  }
  
  function update(&$class, $eventID, $paramsArray) {
    global $db;
    $commission = 0;
    
    if (isset($_SESSION['referrer_key']) && zen_not_null($_SESSION['referrer_key'])) {
      $sql = "SELECT referrer_customers_id, referrer_approved, referrer_banned, referrer_commission 
                FROM " . TABLE_REFERRERS . " 
               WHERE referrer_key = '" . $_SESSION['referrer_key'] . "'";
      $query = $db->Execute($sql);

      if (!$query->EOF) {
        $commission = floatval($query->fields['referrer_commission']);
        if ($commission < 0) {
          $commission = 0;
        }
      }
    } 
    
    /*----
    ** Allow the commission so long as the referrer has been approved, is not banned and (unless specified by the store's
    ** Configuration->Affiliate Program options) is not the customer associated with the referral!
    */
    if ($commission > 0 && 
        $query->fields['referrer_approved'] != 0 && 
        $query->fields['referrer_banned'] == 0 && 
        (SNAP_AFFILIATE_KEY_USE === 'true' || $query->fields['referrer_customers_id'] != $_SESSION['customer_id'])) {  /*v2.1.0c*/
      $sql_data_array = array('commission_orders_id' => $paramsArray['orders_id'],
                              'commission_referrer_key' => $_SESSION['referrer_key'],
                              'commission_rate' => $commission,
                              'commission_paid' => 0);

      zen_db_perform(TABLE_COMMISSION, $sql_data_array);
      
//-bof-a-v2.3.0      
      // -----
      // If an affiliate's referral_key cookie is to be deleted on a customer's first purchase ... delete the cookie.
      //
      if (SNAP_AFFILIATE_COOKIE_PURCHASES == 'One') {
        setcookie('referrer_key', '', time() - 3600, '/');
      }
//-eof-a-v2.3.0

    }
  }
 
}

picandnix:

Yes it's me again...
which file or files are responsible for allowing the affiliate to edit their website details on their affiliate account page please, I can't seem to find it mentioned in the upgrade (2.2>2.3) changed/new files list.I don't have that feature implemented ... yet.

13 Jun 2013, 12:34 PM
#90
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

lat9:

Reading through the thread on this plugin's parent, I generated the following "wish list" from features requested:

  • (2.0.0) Move language-specific constants to language files to allow language translation
  • (2.0.0) Use built-in currency formatting so that the amounts show in the store's default currency
  • (2.1.0) Allow customization to control which order-status values should "trigger" a commission, e.g. no commission on 'Pending' order status.
  • Better email system
  • More detailed application (payment choice)
  • The ability to create an affiliate account without needed a store account.
  • (2.1.0) A configuration switch that identifies whether or not an affiliate gets commission when placing an order with their affiliate key.
  • Commission Rate by category: This will need a code rewrite.
  • Better stats such as Click tracking
  • (2.1.1) SEO Support : Certain SEO modules work with this as is right now. (Like Ultimate SEO's). Others, it's tricky.
  • Ability to edit details in ACP.
  • Ability to deny applications in ACP.
  • Ability to edit details on the customer side. (Some might change websites.)
  • Ability to add "Where to send my check?"
  • (2.2.0) Customization of cookie lifetime
  • COLOR="#FF0000"[/COLOR] Customer Purchases per Cookie - All vs. One

No promises on when these would be implemented, but if current users would "chime in" with their priority order I'd have a better idea of where to focus; at this time I'm handling the low-hanging (i.e. easiest) fruit first!
Wishlist updates shown above.

13 Jun 2013, 12:39 PM
#91
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Snap Affiliates v2.0 for v1.5.0 and later

I don't have that feature implemented ... yet.

hmm, had you been playing around with that feature already? I ask because when I simply did a drag n drop overwrite into my local version this feature shows up on the affiliates account page along with an edit button and the domain name linked to the affiliate account. However the edit button didn't work, so rather than repeating the overwrite method for my live site I simply followed the upgrade instructions and uploaded/edited the new/changed files as per instructions....the edit option as described above did not show (hence my original question).
fyi I used the 2.3zip from your site rather than plugin area.

13 Jun 2013, 1:17 PM
#92
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

picandnix:

hmm, had you been playing around with that feature already? I ask because when I simply did a drag n drop overwrite into my local version this feature shows up on the affiliates account page along with an edit button and the domain name linked to the affiliate account. However the edit button didn't work, so rather than repeating the overwrite method for my live site I simply followed the upgrade instructions and uploaded/edited the new/changed files as per instructions....the edit option as described above did not show (hence my original question).
fyi I used the 2.3zip from your site rather than plugin area.
Yes, I'd been "playing" ... :censored: I've got to pay more attention! I missed the update to observer-class file regardless of where you picked the zip-file up.

14 Jun 2013, 1:10 PM
#93
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

I've submitted v2.4.0 to the Plugins area and asked that my v2.3.0 submission be quietly trashed. Updates to v2.4.0:

  1. BUGFIX: Didn't include the updated version of /includes/classes/observers/class.snap_order_observer.php in the v2.3.0 distribution!
  2. BUGFIX: Corrected files changed for this version to properly reflect the template file that was changed.
  3. BUGFIX: Completed partially-completed referrer_edit page processing.
14 Jun 2013, 1:15 PM
#94
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

Wish-list updated:

  • (2.0.0) Move language-specific constants to language files to allow language translation
  • (2.0.0) Use built-in currency formatting so that the amounts show in the store's default currency
  • (2.1.0) Allow customization to control which order-status values should "trigger" a commission, e.g. no commission on 'Pending' order status.
  • Better email system
  • More detailed application (payment choice)
  • The ability to create an affiliate account without needed a store account.
  • (2.1.0) A configuration switch that identifies whether or not an affiliate gets commission when placing an order with their affiliate key.
  • Commission Rate by category: This will need a code rewrite.
  • Better stats such as Click tracking
  • (2.1.1) SEO Support : Certain SEO modules work with this as is right now. (Like Ultimate SEO's). Others, it's tricky.
  • Ability to edit details in ACP.
  • Ability to deny applications in ACP.
  • COLOR="#FF0000"[/COLOR] Ability to edit details on the customer side. (Some might change websites.)
  • Ability to add "Where to send my check?"
  • (2.2.0) Customization of cookie lifetime
  • (2.3.0) Customer Purchases per Cookie - All vs. One
14 Jun 2013, 11:33 PM
#95
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Snap Affiliates v2.0 for v1.5.0 and later

That was fast, thank you.
I have just implimated 2.v, however when logged in as customer/affiliate, and clicking to edit affiliate domain the page goes to Page Not Found at this url https://www.mysite.com/index.php?main_page=FILENAME_REFERRER_EDIT
Have I missed something? I followed the 2.3>2.4 upgrade methods.
No error Logs generated.

15 Jun 2013, 11:55 AM
#96
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

FILENAME_REFERRER_EDIT is located in /includes/extra_datafiles/snap_file_database_names.php ... it's really there, I looked!

15 Jun 2013, 12:39 PM
#97
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Snap Affiliates v2.0 for v1.5.0 and later

lat9:

FILENAME_REFERRER_EDIT is located in /includes/extra_datafiles/snap_file_database_names.php ... it's really there, I looked!

You're right (naturally). I must have blinked and missed it when I followed the 'upgrade to v2.4' details in the readme...
Oh hang on, I blinked again and still can't see it mentioned there :wink:

26 Jul 2013, 6:08 PM
#98
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

v2.4.1 is now available in the Plugins area:

  • BUGFIX: Referrer website link was relative instead of absolute on admin's Customers->Referrers.
  • BUGFIX: Link on Customers->Orders takes you to the customer, not the referrer.
26 Jul 2013, 6:19 PM
#99
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: Snap Affiliates v2.0 for v1.5.0 and later

lat9:

v2.4.1 is now available in the Plugins area:

  • BUGFIX: Referrer website link was relative instead of absolute on admin's Customers->Referrers.
  • BUGFIX: Link on Customers->Orders takes you to the customer, not the referrer.

There goes my quiet Friday night :wink: thank you for the update Lat9.

7 Aug 2013, 9:08 PM
#100
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Snap Affiliates v2.0 for v1.5.0 and later

v2.5.0 is now available in the Plugins:

  • Note: Admin configuration version updated to v2.5.0.
  • BUGFIX: Not updating date_modified field when performing a database update on the module's version number.
  • BUGFIX: referrers_main page content did not account for excluded order status'.
  • Added Combine Exclusions on Referrers Page? configuration variable and associated processing.
  • Added an updated_by column to the orders_status_history table; use common functions when performing an orders_status_history table update.
  • When a commission is paid to one of your store's affiliate-marketers, an orders_status_history record is created for the associated order(s) to note that event (along with the admin name/id of the person who clicked the "Pay" button).
  • BUGFIX: Commission-paid dates on the referrers_main page were formatted incorrectly.
  • BUGFIX: Activity date-range on the referrers_main page should find commission-payments in the range, not referred-customer purchases.