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,410

Results 221 to 240 of 464
12 Jul 2014, 4:56 PM
#221
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

If you do the SNAP file upgrade from 2.1.2 to 2.7.0, the PHP files on the admin side will handle the database updates required automatically.

14 Jul 2014, 6:04 PM
#222
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 just submitted v2.7.1 to the Plugins; it will be available for download (http://www.zen-cart.com/downloads.php?do=file&id=1635) once approved.

This version picks up a template-file change for Zen Cart v1.5.3 that was previously missed and displays each referrer's email address within the Customers->Referrers page.

14 Jul 2014, 10:32 PM
#223
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

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

Just a suggestion, if an account has an affiliate account active show "Affiliate Admin" next to account link

Customer Name | Affiliate Admin | logout

14 Jul 2014, 10:51 PM
#224
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

ShopVille:

Just a suggestion, if an account has an affiliate account active show "Affiliate Admin" next to account link

Customer Name | Affiliate Admin | logout
Are you suggesting a link to a customer's affiliate account from the Customers->Customers main display for affiliate customers (using some kind of visual clue/icon)?

14 Jul 2014, 11:00 PM
#225
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

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

Yes for customer front end

21 Jul 2014, 12:27 PM
#226
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:

I've just submitted v2.7.1 to the Plugins; it will be available for download (http://www.zen-cart.com/downloads.php?do=file&id=1635) once approved.

This version picks up a template-file change for Zen Cart v1.5.3 that was previously missed and displays each referrer's email address within the Customers->Referrers page.
Version 2.7.1 is now available for download.

13 Sep 2014, 12:49 PM
#227
inklingsolutions avatar

inklingsolutions

New Zenner

Join Date:
Apr 2009
Posts:
35
Plugin Contributions:
0

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

Am I missing something, I don't see an images/referrers folder in the zip download? I've used the earlier version of snap in my 1.3.9 store and i'm installing this on a new 1.5 store. I use my own designed banners for my affiliates and this new version seems to be set up a bit different. The instructions, referenced a template in the images/referrers folder but it's not there.

Any help would be awesome.

Thanks for the module and effort, it's greatly appreciated.

13 Sep 2014, 1:28 PM
#228
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

You're not missing anything; when I transitioned to github, I'm apparently "ignoring" the /images directory.:censored:

The /images/referrers directory is being used by the plugin and I'll get the plugin's distribution updated -- thanks for the report!

13 Sep 2014, 1:30 PM
#229
inklingsolutions avatar

inklingsolutions

New Zenner

Join Date:
Apr 2009
Posts:
35
Plugin Contributions:
0

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

No worries, figured it out and got it all working.

I do have a question. In the earlier mod version, there was a work around to have multiple banners of the same size.

For example, i'm using ref.120.600.jpg. If wanted to use another 120x600 jpg banner is there a method or work around for this?

Thanks

13 Sep 2014, 1:43 PM
#230
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

inklingsolutions:

No worries, figured it out and got it all working.

I do have a question. In the earlier mod version, there was a work around to have multiple banners of the same size.

For example, i'm using ref.120.600.jpg. If wanted to use another 120x600 jpg banner is there a method or work around for this?

Thanks
There's not a method (yet), but what if any file matching the "template" /images/referrers/ref*.120.600.jpg was detected as being a banner image?

13 Sep 2014, 3:10 PM
#231
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:

There's not a method (yet), but what if any file matching the "template" /images/referrers/ref*.120.600.jpg was detected as being a banner image?
I don't have my SNAP test site available, but here's (as yet untested) what I propose using as a replacement for /includes/modules/pages/referrer_tools/header_php.php:

<?php
// +---------------------------------------------------------------------------+
// |Snap Affiliates for Zen Cart                                               |
// +---------------------------------------------------------------------------+
// | Copyright (c) 2013-2014, Vinos de Frutas Tropicales (lat9) for ZC 1.5.0+  |
// |                                                                           |
// | Original: Copyright (c) 2009 Michael Burke                                |
// | http://www.filterswept.com                                                |
// |                                                                           |
// +---------------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license.            |
// +---------------------------------------------------------------------------+

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));

define('DIR_WS_IMAGES_REFERRERS', DIR_WS_IMAGES . 'referrers/');

if (!$_SESSION['customer_id']) {
  $_SESSION['navigation']->set_snapshot();
  $messageStack->add_session('login', CAUTION_NEED_LOGIN, 'caution');
  zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}

$is_logged_in = true;

$query = "SELECT * FROM " . TABLE_REFERRERS ." WHERE referrer_customers_id = " . (int)$_SESSION['customer_id'];
$referrer = $db->Execute($query);

if ($referrer->EOF) {
  zen_redirect(zen_href_link(FILENAME_REFERRER_SIGNUP, '', 'SSL'));
}

if (((int)$referrer->fields['referrer_approved']) == 0) {
  zen_redirect(zen_href_link(FILENAME_REFERRER_MAIN, '', 'SSL'));
}

$snap_banners = array();
if (SNAP_AFFILIATE_IMAGES != '') {
  $snap_banner_files = explode('/', SNAP_AFFILIATE_IMAGES);
  foreach ($snap_banner_files as $current_file ) {
    if (zen_not_null($current_file)) {
      $fileinfo = explode(',', $current_file);
      $width = $fileinfo[0];
      $height = $fileinfo[1];
      $extension = $fileinfo[2];
      $filenames = glob (DIR_WS_IMAGES_REFERRERS . "ref*.$width.$height.$extension");
      if ($filenames !== false {
        foreach ($filenames as $filename) {
          $snap_banners[] = array ( 'name' => $filename, 'width' => $width, 'height' => $height );
        }
      }
    }
  }
}

// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_REFERRAL_TOOLS, 'false');
$breadcrumb->add(NAVBAR_TITLE);
13 Sep 2014, 3:23 PM
#232
inklingsolutions avatar

inklingsolutions

New Zenner

Join Date:
Apr 2009
Posts:
35
Plugin Contributions:
0

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

This isn't a dynamic method but for now it's going to have to work for me, since I need to get my store up and this is the only thing hold me back, since i've got a ton affiliates already from using older version of zen cart..

I just wanted to pass this along if someone else needed to add multiple banners of the same size. I updated the tpl_referrer_tools_default.php file. Instead of having the banners generated dynamically, i'm just adding them in manually with the below code repeating and adding in the image page, sizing and banner sizing info.

<div class="imagewrap"><div class="imagetitle">Banner Size Goes Here</div> <img class="referrer_image" src="banner image path here" width="banner width here" height="banner height here" alt="Your image alt-text here" /> <br /> <textarea rows="3" cols="1"><a href="http://your store url&referrer=<?php echo $referrer->fields['referrer_key']; ?>"><img src="banner image path here" width="banner width here" height="banner height here" alt="Your image alt-text here" /></a> </textarea> <br /> </div>

for anyone interested, the above code is replacing

<p><?php echo TEXT_BANNERS; ?></p> <?php foreach ($snap_banners as $current_banner) { echo get_referrer_image($current_banner['width'], $current_banner['height'], $current_banner['name']); } } ?>

you also must delete lines 54-56:

<?php if (is_array($snap_banners) && count($snap_banners) != 0) { ?>

Sorry for the hack up job but, time is important right now. When I have more time, i'm going to look into a dynamic fix if one hasn't been worked out by the time I get around to it :o)

24 Sep 2014, 6:29 PM
#233
duffy avatar

duffy

New Zenner

Join Date:
Aug 2005
Location:
Johnstown, PA, USA
Posts:
45
Plugin Contributions:
0

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

Hi lat9,

What a truly fantastic mod, thank you so much for all your hard work.
I have installed this along with many other modifications including Ty Packager Tracker. With the files you provided for this integration, all seems to be working quite well with one small exception. When adding the tracking number to customer's order the comments generated to include a link to the shippers tracking info gives the following:

Your USPS Tracking ID is ***************
https://tools.usps.com/go/TrackConfirmAction!input.action?tLabels=****************>Click here</a> to track your package.
If the above link does not work, copy the following URL address and paste it into your Web browser.
https://tools.usps.com/go/TrackConfirmAction!input.action?tLabels=****************

It may take up to 24 hours for the tracking information to appear on the website.
It seems to me this is generated in admin/includes/classes/observers/class.ty_package_tracker but not being a coder, I have no idea how to correct it. Everything I try 'breaks' the page.
Thanks in advance for your response, and many,many thanks for this great contribution!

Duffy

25 Sep 2014, 11:28 AM
#234
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

Duffy, you're correct about which module inserts that tracking information. I'll need to review that integration code-merge to see what's up. Where does that "funky" display show up? On the display? In HTML emails? In text emails?

25 Sep 2014, 1:58 PM
#235
duffy avatar

duffy

New Zenner

Join Date:
Aug 2005
Location:
Johnstown, PA, USA
Posts:
45
Plugin Contributions:
0

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

It shows up in all three plus. On the admin order screen in the comments section, in emails and in the customer's account history when reviewing orders.

25 Sep 2014, 7:11 PM
#236
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

Hmm, it looks like your language definition is missing an anchor start. Do lines 32-45 of the identified file look like this?

      case 'ZEN_UPDATE_ORDERS_HISTORY_PRE_EMAIL': {
        $track_id = $this->get_track_ids();
        if (is_array($track_id)) {
          foreach ($track_id as $id => $track) {
            if (zen_not_null($track) && constant('CARRIER_STATUS_' . $id) == 'True') {
              if (zen_not_null($osh_additional_comments)) {
                $osh_additional_comments .= "\n";
              }
              $osh_additional_comments .= "Your " . constant('CARRIER_NAME_' . $id) . " Tracking ID is " . $track . " \n\t\t<a href=" . constant('CARRIER_LINK_' . $id) . $track . ">Click here</a> to track your package. \n\t\tIf the above link does not work, copy the following URL address and paste it into your Web browser. \n\t\t" . constant('CARRIER_LINK_' . $id) . $track . "\n\nIt may take up to 24 hours for the tracking information to appear on the website.";
            }
          }
        }
        break;
      }
25 Sep 2014, 7:32 PM
#237
duffy avatar

duffy

New Zenner

Join Date:
Aug 2005
Location:
Johnstown, PA, USA
Posts:
45
Plugin Contributions:
0

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

Yes. It looks exactly like that.

25 Sep 2014, 8:44 PM
#238
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

Change that code fragment to

      case 'ZEN_UPDATE_ORDERS_HISTORY_PRE_EMAIL': {
        $track_id = $this->get_track_ids();
        if (is_array($track_id)) {
          foreach ($track_id as $id => $track) {
            if (zen_not_null($track) && constant('CARRIER_STATUS_' . $id) == 'True') {
              if (zen_not_null($osh_additional_comments)) {
                $osh_additional_comments .= "\n";
              }
              $osh_additional_comments .= "Your " . constant('CARRIER_NAME_' . $id) . " Tracking ID is " . $track  . "\n\nIt may take up to 24 hours for the tracking information to appear on the website.\n\n";
            }
          }
        }
        break;
      }

The additional information is extraneous.

25 Sep 2014, 9:18 PM
#239
duffy avatar

duffy

New Zenner

Join Date:
Aug 2005
Location:
Johnstown, PA, USA
Posts:
45
Plugin Contributions:
0

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

Perfect!! Works great. THANK YOU SO VERY MUCH!!:clap:

25 Sep 2014, 9:36 PM
#240
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

You're welcome. I'll include that update as an optional installation element in the next release of the SNAP Affiliates plugin. Thanks for the heads-up that the changes caused "funkiness" in the display