Page 1 of 46 12311 ... LastLast
Results 1 to 10 of 460
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Snap Affiliates v2.0 for v1.5.0 and later

    I'll be submitting this plugin to the Plugins area shortly, based on the similar-named plugin for the v1.3.x series (http://www.zen-cart.com/showthread.p...nap-affiliates). This version (v2.0.0) will run only on Zen Cart v1.5.0 and later and includes the following additional changes:

    • No core-file overwrites!
    • Moved all language-specific text to the language file, both catalog and admin.
    • Moved $_SESSION['referrer'] initialization to /includes/init_includes/init_snap.php and /includes/auto_loaders/config.snap.php; /includes/application_top.php is no longer changed by this plugin.
    • Moved changes to /includes/database_tables.php and /includes/filenames.php to /includes/extra_datafiles/snap_file_database_names.php; those core files are no longer changed by this plugin.
    • Moved order-related commission updates to observer-class code; /includes/classes/order.php is no longer changed by this plugin.
    • Moved hard-coded referral terms to a separate language define file (/includes/languages/english/html_includes/define_referrer_terms.php and /includes/languages/english/html_includes/YOUR_TEMPLATE/define_referrer_terms.php).
    • Moved /snapconfigure.php file initializations to your admin's Configuration->Affiliate Program.
    • Database initialization is now performed automatically via your Zen Cart admin.
    • Added "Information" sidebox link, controlled via admin configuration switch.
    • Affiliate banner images are now specified via your admin.
    • Commissions are given only to affiliate accounts that are previously authorized and not banned. An affiliate customer can no longer get a discount by using their own affiliate code.
    • Using Zen Cart default email template for all emails sent; no longer require additional templates.

    Once I have the download location, I'll post it back here; it's kind of a chicken/egg thing between the plugin's download link and it's support-thread!

  2. #2
    Join Date
    Dec 2010
    Location
    UK
    Posts
    1,771
    Plugin Contributions
    3

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

    Oh Cindy you absolute star! Thank you very much. I didn't expect you to do it so soon, were you bored?

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

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

    Quote Originally Posted by picandnix View Post
    Oh Cindy you absolute star! Thank you very much. I didn't expect you to do it so soon, were you bored?
    Only a bit

  4. #4
    Join Date
    Dec 2010
    Location
    UK
    Posts
    1,771
    Plugin Contributions
    3

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

    Ok...
    installed on LOCAL copy of store
    loaded just fine thank you, but, when going to admin>customers>referrers I don't have an option to enroll customer into affiliate program

    Name:  affiliate.jpg
Views: 3013
Size:  9.4 KB

    and I'm getting error log as follows

    [05-Mar-2013 21:38:58] PHP Warning: Invalid argument supplied for foreach() in C:\wamp\www\MYSTORE\MYADMIN\referrers.php on line 687

    [05-Mar-2013 21:38:58] PHP Stack trace:

    [05-Mar-2013 21:38:58] PHP 1. {main}() C:\wamp\www\MYSTORE\MYADMIN\referrers.php:0

  5. #5
    Join Date
    Dec 2010
    Location
    UK
    Posts
    1,771
    Plugin Contributions
    3

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

    Sorry timed out to edit post.
    error log is line 514 not 687...

    [05-Mar-2013 21:56:30] PHP Warning: Invalid argument supplied for foreach() in C:\wamp\www\MYSITE\MYADMIN\referrers.php on line 514

    [05-Mar-2013 21:56:30] PHP Stack trace:

    [05-Mar-2013 21:56:30] PHP 1. {main}() C:\wamp\www\MYSITE\MYADMIN\referrers.php:0

    Thank you again Lat9

  6. #6
    Join Date
    Dec 2010
    Location
    UK
    Posts
    1,771
    Plugin Contributions
    3

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

    Quote Originally Posted by picandnix View Post
    Ok...
    installed on LOCAL copy of store
    loaded just fine thank you, but, when going to admin>customers>referrers I don't have an option to enroll customer into affiliate program

    Name:  affiliate.jpg
Views: 3013
Size:  9.4 KB
    Doh! It's the referrers job to APPLY for an affiliate account rather than the admin to award an account isn't it, sorry my mistake.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

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

    Quote Originally Posted by picandnix View Post
    Sorry timed out to edit post.
    error log is line 514 not 687...

    [05-Mar-2013 21:56:30] PHP Warning: Invalid argument supplied for foreach() in C:\wamp\www\MYSITE\MYADMIN\referrers.php on line 514

    [05-Mar-2013 21:56:30] PHP Stack trace:

    [05-Mar-2013 21:56:30] PHP 1. {main}() C:\wamp\www\MYSITE\MYADMIN\referrers.php:0

    Thank you again Lat9
    This one makes more sense (there's no line 687 in the file). There is no provision in the plugin for an administrator to add a referrer; a referrer creates a customer account and signs up themselves. The administrator's job is to approve, ban or pay the referrer.

    That said, the "Details" button shouldn't be shown if there are no referrers, so if you make the following change to line 358 of /YOUR_ADMIN/referrers.php that problem (and the subsequent error logs) will be corrected:
    Code:
           <tr><td class="infoBoxContent"><br /><?php echo ($referrercount > 0) ? ('<a href="' . zen_href_link(FILENAME_REFERRERS, 'referrer=' . $referrers[$selected]['customers_id'] . '&mode=details', 'NONSSL') . '">' . zen_image_button('button_details.gif', IMAGE_DETAILS) . '</a>') : '&nbsp;'; /*v2.0.1c*/ ?></td></tr>

  8. #8
    Join Date
    Dec 2010
    Location
    UK
    Posts
    1,771
    Plugin Contributions
    3

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

    A possible bug?
    once the commission is marked as 'paid' by store admin the affiliate receives an email stating the commission earnings. However in my live test site the email received states my affiliate has received $0.00 even though admin shows that they have been paid $1.00.

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

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

    Quote Originally Posted by lat9 View Post
    ... Once I have the download location, I'll post it back here ...
    It should be in the Plugins area shortly (http://www.zen-cart.com/downloads.php?do=file&id=1635) and you can always download it from my website.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

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

    Quote Originally Posted by picandnix View Post
    A possible bug?
    once the commission is marked as 'paid' by store admin the affiliate receives an email stating the commission earnings. However in my live test site the email received states my affiliate has received $0.00 even though admin shows that they have been paid $1.00.
    An absolute bug, darn it! Make this change, starting at line 208 of /YOUR_ADMIN/referrers.php:
    Code:
        
      case 'pay':
        $query = "UPDATE " . TABLE_COMMISSION . " SET commission_paid = NOW() WHERE commission_paid = '0000-00-00 00:00:00' AND commission_referrer_key = '" . $referrers[$selected]['referrer_key'] . "'";
        $result = $db->Execute($query);
    
        $now = date("Y-m-d H:i:s", time());
        $commission_paid = $referrers[$selected]['orders_unpaid']; /*v2.0.1a*/
        $referrers[$selected]['orders_unpaid'] = 0;
    
        for ($i = 0, $n = count($referrers[$selected]['orders']); $i < $n; $i++) {
          if ($referrers[$selected]['orders'][$i]['commission_paid'] == '0000-00-00 00:00:00') {
            $referrers[$selected]['orders'][$i]['commission_paid'] = $now;
          }
        }
    
        send_notification_email (
          $referrers[$selected], 
          EMAIL_SUBJECT_PAID,
          sprintf(EMAIL_MESSAGE_PAID_TEXT, $currencies->format(floatval($commission_paid)), zen_catalog_href_link(FILENAME_LOGIN, '', 'SSL'), zen_catalog_href_link(FILENAME_REFERRER_MAIN, '', 'SSL'), zen_catalog_href_link(FILENAME_CONTACT_US, '', 'NONSSL')),
          sprintf(EMAIL_MESSAGE_PAID_HTML, $currencies->format(floatval($commission_paid)), zen_catalog_href_link(FILENAME_LOGIN, '', 'SSL'), zen_catalog_href_link(FILENAME_REFERRER_MAIN, '', 'SSL'), zen_catalog_href_link(FILENAME_CONTACT_US, '', 'NONSSL'))); /*v2.0.1c*/
    
        break;
    But wait ... there's more! Update /YOUR_ADMIN/extra_datafiles/referrers_filenames.php:
    Code:
    <?php
    /*
    ** Database tables and filenames associated with the Snap Affiliates v2.0 plugin.
    **
    ** NOTE:  Admin-side definitions!
    */
    define('TABLE_REFERRERS', DB_PREFIX . 'referrers');
    define('TABLE_COMMISSION', DB_PREFIX . 'commission');
    
    define('FILENAME_REFERRERS', 'referrers');
    define('FILENAME_REFERRER_MAIN', 'referrer_main');  /*v2.0.1a*/
    and make the following change starting at line 82 of /YOUR_ADMIN/languages/english/referrers.php:
    Code:
    define('EMAIL_MESSAGE_PAID_HTML', 'A commission payment was recently made for your ' . STORE_NAME . ' referral account. Your total earnings this period were <strong>%1$s</strong>.<br /><br />To view your complete order history, you can login (<a href="%2$s">%2$s</a>) and view your referrer statistics (<a href="%3$s">%3$s</a>). If you have any questions, don\'t hesitate to contact us: <a href="%4$s">%4$s</a>.<br /><br />Sincerely,<br /><br />' . STORE_OWNER); /*v2.0.1c*/
    define('EMAIL_MESSAGE_PAID_TEXT', 'A commission payment was recently made for your ' . STORE_NAME . ' referral account. Your total earnings this period were %1$s.' . "\n\n" . 'To view your complete order history, you can login (%2$s) and view your referrer statistics (%3$s).  If you have any questions, don\'t hesitate to contact us using this link: %4$s.' . "\n\nSincerely,\n\n" . STORE_OWNER); /*v2.0.1c*/

 

 
Page 1 of 46 12311 ... LastLast

Similar Threads

  1. snap-affiliates?
    By JohnBoyCR in forum All Other Contributions/Addons
    Replies: 222
    Last Post: 16 Oct 2016, 08:10 PM
  2. v139h Seperate login for sales affiliates and distributors ?
    By respawnedelectronics in forum General Questions
    Replies: 4
    Last Post: 5 Jul 2014, 04:40 PM
  3. v151 snap affiliates bitcoins
    By unckle fester in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 6 Jun 2014, 07:44 AM
  4. Snap Affiliates Module?
    By asauterChicago in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 12 Apr 2013, 09:45 AM
  5. snap affiliates not emailing
    By mindcraft in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Apr 2012, 11:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR