-
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!
-
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? :wink:
-
Re: Snap Affiliates v2.0 for Zen Cart v1.5.0 and later
Quote:
Originally Posted by
picandnix
Oh Cindy you absolute star! Thank you very much. I didn't expect you to do it so soon, were you bored? :wink:
Only a bit:smile:
-
1 Attachment(s)
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
Attachment 12058
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
-
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 :hug:
-
Re: Snap Affiliates v2.0 for Zen Cart v1.5.0 and later
Quote:
Originally Posted by
picandnix
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
Attachment 12058
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.
-
Re: Snap Affiliates v2.0 for Zen Cart v1.5.0 and later
Quote:
Originally Posted by
picandnix
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 :hug:
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>') : ' '; /*v2.0.1c*/ ?></td></tr>
-
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.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
lat9
... 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.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
picandnix
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*/
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Working perfectly now :hug:
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Installed Module.
Seems to be working.
What are the standard instructions to the affiliate for payment options?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
you have to pay them manually by your preferred method, i.e PayPal or cheque.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Thanks for the quick reply.
When going to the Affiliate Tools web page under Marketing Tools, the first link includes "www.mysite.com/&referrer=CodedNo..." however when selecting that link it results in a "Page Not Found" at Mysite.com?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I can't replicate that error, are you logged in as a 'customer'?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I'm logged in as a customer. At the tab "Marketing Tools" It says
HTML Code:
"Site Link
The following link can be used anywhere you want to promote this site. Copy and paste the HTML code following each image into your blog or web page to link to us."
That link includes the customer's affiliate ID or the link states <a href="http://www.mysite.com/&referrer=CodedNo...">Gifts for all occasions....</a>
That link ends up at "Page Not Found"
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Do you have any other domains that you can add your own test link on? To link back to your store, to test how the mod works fully?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Don't have any other domains right now.
The question is when a customer puts the link image of my site on there web site, when that link is selected what web page on my site is it navigating to?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
In your admin's Configuration->Affiliate Program, what do you have "Affiliate Key Prefix" set to?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
mikebr
Don't have any other domains right now.
The question is when a customer puts the link image of my site on there web site, when that link is selected what web page on my site is it navigating to?
using the default option links to homepage but you Vann also select a specific product too by using the tool in the box.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
lat9
In your admin's Configuration->Affiliate Program, what do you have "Affiliate Key Prefix" set to?
The key is set to CNWR_
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
picandnix
using the default option links to homepage but you Vann also select a specific product too by using the tool in the box.
The default option links to "Page Not Found"
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
mikebr
I'm logged in as a customer. At the tab "Marketing Tools" It says
HTML Code:
"Site Link
The following link can be used anywhere you want to promote this site. Copy and paste the HTML code following each image into your blog or web page to link to us."
That link includes the customer's affiliate ID or the link states <a href="http://www.mysite.com/&referrer=CodedNo...">Gifts for all occasions....</a>
That link ends up at "Page Not Found"
It looks like you've got one of the SEO plugins installed as well. In a "standard" Zen Cart installation, the generated link should be of the form
Code:
<a href="http://www.mysite.com/index.php?main_page=index&referrer=CNWR_21362757845">Gifts For All Occasions At GiftaDoodle.com</a>
Looking through the posts in the support thread associated with this plugin's parent, it appears that there are known issues using the affiliates plugins with some (or all?) of the SEO plugins. You might ask in the support forum associated with the SEO plugin that you're using how to include an additional $_GET variable in the URL that they're generating.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
All users of this plugin, please note that (in the US, anyway) there are tax implications associated with creating an affiliate program for your website. I am neither a lawyer nor an accountant, but you should perform your own due diligence by googling affiliate marketing 1099.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
v2.0.0 of the plugin is now available in the Zen Cart Plugins area: http://www.zen-cart.com/downloads.php?do=file&id=1635
I'm preparing (and will submit later today) v2.1.0 with the following changes:
- BUGFIX: Don't display "Details" button if there are no affiliates (yet).
- BUGFIX: Payment email to affiliate always shows $0.00.
- BUGFIX: Approval and payment emails show FILENAME_REFERRER_MAIN for referrer_main page link.
- BUGFIX: Payment email shows referrer_main as link for "Contact Us".
- BUGFIX: Pagination on Customers->Referrers was broken. Also, moved maximum number of affiliates to display to a configuration setting.
- Added a configuration switch to control whether or not a customer receives a commission on purchases made with their affiliate key in their account.
- Added a configuration setting to identify any Orders Status codes that should not receive a commission.
- BUGFIX: Disable the "Pay" button if the affiliate's current commission value is 0.
- "Prettied-up" the account-activation and commission-payment HTML email text.
- Added validation for the commission-rate entry in Customers->Referrers.
- BUGFIX: Missed a couple of admin-side language values (details buttons values).
- If the affiliate's account is not approved, the "Ban", "Pay" and "Update" buttons are disabled.
- Added a section to the readme identifying how to upgrade from previous versions of the plugin.
In addition, I've updated the admin-side auto-install to be version-cognizant so that the configuration additions made for v2.1.0 won't disrupt/change any of your existing configuration settings, they're just added to the database!
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
lat9
It looks like you've got one of the SEO plugins installed as well. In a "standard" Zen Cart installation, the generated link should be of the form
Code:
<a href="http://www.mysite.com/index.php?main_page=index&referrer=CNWR_21362757845">Gifts For All Occasions At GiftaDoodle.com</a>
Looking through the posts in the support thread associated with this plugin's
parent, it appears that there are known issues using the affiliates plugins with some (or all?) of the SEO plugins. You might ask in the support forum associated with the SEO plugin that you're using how to include an additional $_GET variable in the URL that they're generating.
Ceon's SEO Plugin is installed.
In the customers account when navigating to 'Marketing tools' The Site Link Generator produces the following code:
<a href="http://www.mysite.com/?zenid=a9oo496a04v6s5ujt7ts7rgi44&referrer=CNEY_7013629850121">Gifts</a>
This code does link to the Home Page.
I understand the standard Zen Cart configuration should produce the following:
<a href="http://www.mysite.com/index.php?main_page=index&referrer=CNEY_7013629850121">Gifts</a>
Is there a problem with the generated code?
The Deep Link Generator Transform Generator Produces the following Code:
http://www.mysite.com/&referrer=CNEY_7013629850121
This code is wrong and links to "Page not found"
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Mike, try replacing your copy of /includes/modules/pages/referrer_tools/jscript_tools.php with:
Code:
<script type="text/javascript"><!--
var referrerPrefix = "<?php echo SNAP_KEY_PREFIX; ?>";
var referrerKey = "<?php echo $referrer->fields['referrer_key']; ?>";
var link_hint = "<?php echo TEXT_PASTE_LINK_HERE; ?>";
function transform() {
var textArea = document.getElementById("referrerLinkDump");
var linkPrefix = '&';
if( textArea ) {
if( textArea.value.indexOf( "&referrer=" + referrerPrefix ) == -1 && textArea.value != link_hint ) {
if (textArea.value.indexOf( '?' ) == -1) {
linkPrefix = '?';
}
textArea.value += linkPrefix + "referrer=" + referrerKey;
}
}
}
function removeTip(textArea) {
if( textArea.value == link_hint ) {
textArea.style.color = "black";
textArea.value = "";
}
}
function addTipIfBlank(textArea) {
if( textArea.value == "" ) {
textArea.value = link_hint;
textArea.style.color = "grey";
}
}
//--></script>
If the link contains a '?', the referrer variable will be added with an & otherwise it'll be added with a ?.
See if that helps.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
lat9
Mike, try replacing your copy of /includes/modules/pages/referrer_tools/jscript_tools.php with:
Code:
<script type="text/javascript"><!--
var referrerPrefix = "<?php echo SNAP_KEY_PREFIX; ?>";
var referrerKey = "<?php echo $referrer->fields['referrer_key']; ?>";
var link_hint = "<?php echo TEXT_PASTE_LINK_HERE; ?>";
function transform() {
var textArea = document.getElementById("referrerLinkDump");
var linkPrefix = '&';
if( textArea ) {
if( textArea.value.indexOf( "&referrer=" + referrerPrefix ) == -1 && textArea.value != link_hint ) {
if (textArea.value.indexOf( '?' ) == -1) {
linkPrefix = '?';
}
textArea.value += linkPrefix + "referrer=" + referrerKey;
}
}
}
function removeTip(textArea) {
if( textArea.value == link_hint ) {
textArea.style.color = "black";
textArea.value = "";
}
}
function addTipIfBlank(textArea) {
if( textArea.value == "" ) {
textArea.value = link_hint;
textArea.style.color = "grey";
}
}
//--></script>
If the link contains a '?', the referrer variable will be added with an & otherwise it'll be added with a ?.
See if that helps.
Works Great!!
Thank You
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Thanks for letting me know, Mike. Since that change is "global", I'll include it in a future update.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
v2.1.0 is now available in the Zen Cart Plugins ...
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Thanks for working on this. I was wondering - while reading this thread and the older one, will this module work with simple seo mod installed? I did not find an answer in the parent forum...before installing, I figured I'd ask.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
kman55
Thanks for working on this. I was wondering - while reading this thread and the older one, will this module work with simple seo mod installed? I did not find an answer in the parent forum...before installing, I figured I'd ask.
I haven't tested with any of the SEO mods. All I can suggest is installing in a test directory to see if it "plays well together".
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
kman55
Thanks for working on this. I was wondering - while reading this thread and the older one, will this module work with simple seo mod installed? I did not find an answer in the parent forum...before installing, I figured I'd ask.
briefly playing with this mod on a zencart with simple seo, image handler, checkout without an account and various other modules and everything seems to be working just fine. I'll keep playing and report back if I find anything that seems to be out of wack. again, thank you for working on this much needed mod.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
lat9
I haven't tested with any of the SEO mods. All I can suggest is installing in a test directory to see if it "plays well together".
So far, I can quickly link to internal pages without a problem. However, to create a link to a category or subcategory page - I get a 404 page not found. If anyone else has a solution or can direct me to a solution - I would be grateful.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Which version of the plugin are you using? I think that the jscript change that's included in v2.1.0 might help. I've tried going to your site and manually adding the ?referrer=CNFW_9999 to the end of the URI without any 404's.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I am actually testing it on another domain. I was able to get it to work. For other who might be reading this, in my Admin>Configuration>SEO URL - I changed the "add cpath to product url" to true. That fixed the 404 errors. I am now able to link to internal product pages, category pages, sub category pages as well as the home page.
I do have a question - how long does the cookie for an affiliate's ID remain valid? 3 months? 6 months? Forever? Also, if the same customer that the affiliate sends purchases something today, and then again 2 weeks from now, would the affiliate still get credit on that purchase?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
The cookie is set for 365 days in /includes/init_includes/init_snap.php (sounds like a good candidate for an admin configuration value in the future). If the customer does not clear their cookies, the cookie (once set) lasts for the duration set in the initialization script, so Yes, the affiliate would still get credit on that purchase.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
For all you guys who use this module, let me ask you a quick question. I just installed it on a 1.5.1 site. Everything looks good, except during my testing, my test account doesn't seem to be earning any commissions.
For example, I created a referral account. Then using the Link Creator, I created a custom URL for a product in my store. I then logged on as a DIFFERENT user and clicked that link, made a purchase, and I hoped to see an earned commission for my test account. However, I am seeing nothing under the Order History for the affiliate account. It's as if nothing was registered.
Any ideas what I could be missing? I do see a cookie being created on my machine which records the referrer_key in there.
I just don't know why it's not recording the sale after I purchase something while using the affiliate URL as a test. I hope anyone using this module can let me know your thoughts!
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
Jeff_Mash
For all you guys who use this module, let me ask you a quick question. I just installed it on a 1.5.1 site. Everything looks good, except during my testing, my test account doesn't seem to be earning any commissions.
For example, I created a referral account. Then using the Link Creator, I created a custom URL for a product in my store. I then logged on as a DIFFERENT user and clicked that link, made a purchase, and I hoped to see an earned commission for my test account. However, I am seeing nothing under the Order History for the affiliate account. It's as if nothing was registered.
Any ideas what I could be missing? I do see a cookie being created on my machine which records the referrer_key in there.
I just don't know why it's not recording the sale after I purchase something while using the affiliate URL as a test. I hope anyone using this module can let me know your thoughts!
you have posted the same question in v1 of this module, so, which version are you using and which version of ZC are you using?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I am using v2.10. I accidentally posted in the other thread before seeing this one. I appreciate any help you (or anyone) can contribute to my problem. I'm sure it's something silly, but for the life of me, I don't know why it isn't tracking affiliate sales. I do use the Ultimate SEO add-on, but from what I have read, this newer version should work. I don't get any 404 errors or anything with custom URL's. In fact, my URLS look like this and load fine (edited out my domain, but hover over the link to see the format):
http://www.MYDOMAIN.com/store/space-...44491364328461
But when I place an order using that link, and then when I log into my referral account, it doesn't have record of the sale.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
UPDATE: I don't know what happened, but I deleted the cookie, tried again, and now it seems to work. The cookie looks the same to me as the one I deleted, so I don't know what could have been different. If I see any other issues though, I will bring them up here.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
Jeff_Mash
I am using v2.10. I accidentally posted in the other thread before seeing this one. I appreciate any help you (or anyone) can contribute to my problem. I'm sure it's something silly, but for the life of me, I don't know why it isn't tracking affiliate sales. I do use the Ultimate SEO add-on, but from what I have read, this newer version should work. I don't get any 404 errors or anything with custom URL's. In fact, my URLS look like this and load fine (edited out my domain, but hover over the link to see the format):
http://www.MYDOMAIN.com/store/space-...44491364328461
But when I place an order using that link, and then when I log into my referral account, it doesn't have record of the sale.
Does your store orders area have a record of the sale though?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
Jeff_Mash
UPDATE: I don't know what happened, but I deleted the cookie, tried again, and now it seems to work. The cookie looks the same to me as the one I deleted, so I don't know what could have been different. If I see any other issues though, I will bring them up here.
Nice one :smile:
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I did notice one issue though. Perhaps you could clarify if it's a bug, or something that can easily be corrected.
The way the module works is that it provides you with TWO WAYS of referring a person to the website:
1. You can use the SITE LINK
2. Or you can use the DEEP LINK GENERATOR
However, a cookie is only being created when our user clicks on the site link. It does NOT create the cookie of they click on the deep link generated link.
Here are the two formats of the URL:
SITE LINK FORMAT:
http://www.domain.com/store/&referre...44491364328461 <-----THIS WORKS. COOKIE IS CREATED
DEEP LINK FORMAT:
http://www.domain.com/store/space-tr...44491364328461 <---NO COOKIE CREATED
Any idea why that would be? Should the ampersand be changed to a question mark on the DEEP LINK format? Should a trailing backslash be used before it?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
Jeff_Mash
I did notice one issue though. Perhaps you could clarify if it's a bug, or something that can easily be corrected.
The way the module works is that it provides you with TWO WAYS of referring a person to the website:
1. You can use the SITE LINK
2. Or you can use the DEEP LINK GENERATOR
However, a cookie is only being created when our user clicks on the site link. It does NOT create the cookie of they click on the deep link generated link.
Here are the two formats of the URL:
SITE LINK FORMAT:
http://www.domain.com/store/&referre...44491364328461 <-----THIS WORKS. COOKIE IS CREATED
DEEP LINK FORMAT:
http://www.domain.com/store/space-tr...44491364328461 <---NO COOKIE CREATED
Any idea why that would be? Should the ampersand be changed to a question mark on the DEEP LINK format? Should a trailing backslash be used before it?
Jeff, what URL rewriter are you using? There are known problems with this add-on and the various flavors of rewriters. What version of the affiliates plugin are you using?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
lat9
Jeff, what URL rewriter are you using? There are known problems with this add-on and the various flavors of rewriters. What version of the affiliates plugin are you using?
I am using ULTIMATE SEO add-on, and the latest version of Snap Affiliates v2.1.0.
I believe this is the SEO add on right here:
http://www.zen-cart.com/downloads.php?do=file&id=132
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Jeff (and any others that are having "issues" with the rewriters), try replacing your copy of /includes/templates/YOUR_TEMPLATE/templates/tpl_referrer_tools_default.php with
Code:
<?php
// +----------------------------------------------------------------------+
// |Snap Affiliates for Zen Cart |
// +----------------------------------------------------------------------+
// | Copyright (c) 2013, 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. |
// +----------------------------------------------------------------------+
function get_referrer_link($base) {
global $referrer;
$result = '';
if (!$referrer->EOF) {
$result = zen_href_link($base, 'referrer=' . $referrer->fields['referrer_key'], 'NONSSL'); /*v2.1.1c*/
}
return $result;
}
function get_referrer_image($width, $height, $filename) {
$image_html = '';
$alt = TEXT_IMAGE_ALT_TEXT;
$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;
}
?>
<div class="centerColumn" id="referrerToolsDefault">
<div id="refSignupLinks">
<a href="<?php echo zen_href_link(FILENAME_REFERRER_MAIN, '', 'SSL');?>"><?php echo TEXT_ORDERS_PAYMENTS; ?></a> | <?php echo TEXT_MARKETING_TOOLS; ?> | <a href="<?php echo zen_href_link(FILENAME_REFERRER_SIGNUP, 'terms', 'SSL');?>"><?php echo TEXT_REFERRER_TERMS; ?></a>
</div>
<h3><?php echo HEADING_SITE_LINK; ?></h3>
<p><?php echo TEXT_SITE_LINK; ?></p>
<p class="centered"><a href="<?php echo get_referrer_link(FILENAME_DEFAULT); ?>"><?php echo TEXT_MARKETING_TEXT; ?></a></p>
<textarea rows="3" cols="1"><a href="<?php echo get_referrer_link(FILENAME_DEFAULT); ?>"><?php echo TEXT_MARKETING_TEXT; ?></a></textarea>
<h3><?php echo HEADING_DEEP_LINK; ?></h3>
<?php require($define_page); ?>
<textarea rows="3" cols="1" style="color: grey;" onfocus="removeTip(this);" onblur="addTipIfBlank(this);" id="referrerLinkDump"><?php echo TEXT_PASTE_LINK_HERE; ?></textarea>
<input type="button" onclick="transform();" value="Transform" />
<?php
if (is_array($snap_banners) && count($snap_banners) != 0) {
?>
<br /><br />
<h3><?php echo HEADING_BANNERS; ?></h3>
<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']);
}
}
?>
</div>
and your copy of /includes/modules/pages/referrer_tools/jscript_tools.php with:
Code:
<script type="text/javascript"><!--
var referrerPrefix = "<?php echo SNAP_KEY_PREFIX; ?>";
var referrerKey = "<?php echo $referrer->fields['referrer_key']; ?>";
var link_hint = "<?php echo TEXT_PASTE_LINK_HERE; ?>";
function transform() {
var textArea = document.getElementById("referrerLinkDump");
var linkPrefix = '&';
if( textArea ) {
if( textArea.value.indexOf( "&referrer=" + referrerPrefix ) == -1 && textArea.value.indexOf( "?referrer=" + referrerPrefix) == -1 && textArea.value != link_hint ) {
if( textArea.value.indexOf( '?' ) == -1) {
linkPrefix = '?';
}
if( textArea.value.indexOf( "&" ) == -1 && textArea.value.indexOf( "?" ) == -1 && textArea.value.charAt( textArea.value.length-1 ) != "/" ) {
textArea.value += "/";
}
textArea.value += linkPrefix + "referrer=" + referrerKey;
}
}
}
function removeTip(textArea) {
if( textArea.value == link_hint ) {
textArea.style.color = "black";
textArea.value = "";
}
}
function addTipIfBlank(textArea) {
if( textArea.value == "" ) {
textArea.value = link_hint;
textArea.style.color = "grey";
}
}
//--></script>
I believe that those changes will allow your static URLs to accept the referrer variable.
When all looks good, I'll package the changes and upload.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
That seemed to work for me! I can verify that the cookie is now created using the Deep Link Generator with the Ultimate SEO add-on.
Thanks for fixing the issue, and I'm glad I could help contribute to making the module even better than it was before!
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I've uploaded v2.1.1 to the Plugins area; it contains the two updated files for the referrer_tools page.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I did bad!
The auto-install that I introduced in v2.1.0, on fresh installs, does not recognize that it's been installed and keeps creating the Affiliate Program configuration_group item over and over and over and over ... (you get the idea).
Here's an update to /YOUR_ADMIN/includes/functions/extra_functions/init_referrers.php that provides the appropriate cleanup.
Code:
<?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');
}
define('SNAP_MODULE_CURRENT_VERSION', '2.1.2'); /*v2.1.2c*/
define('SNAP_MODULE_UPDATE_DATE', '2013-04-08'); /*v2.1.2c*/
//----
// Create each of the database tables for the referrers plugin, if they don't already exist.
//
$sql = "CREATE TABLE IF NOT EXISTS " . TABLE_REFERRERS . " (
referrer_customers_id int(11) not null primary key,
referrer_key varchar(32) not null,
referrer_homepage text not null,
referrer_approved tinyint(4) not null,
referrer_banned tinyint(4) not null,
referrer_commission float not null
)";
$db->Execute($sql);
$sql = "CREATE TABLE IF NOT EXISTS " . TABLE_COMMISSION . " (
commission_orders_id int(11) not null primary key,
commission_referrer_key varchar(96) not null,
commission_rate float not null,
commission_paid datetime not null
)";
$db->Execute($sql);
//----
// Create the Configuration->Affiliate Program item, if it's not already there.
//
$configurationGroupTitle = 'Affiliate Program';
$currentVersion = SNAP_MODULE_CURRENT_VERSION;
$currentDescription = SNAP_MODULE_UPDATE_DATE . ', Vinos de Frutas Tropicales';
//-bof-v2.1.2c-Provide fix-up for problem with previous versions' auto-install
$configuration = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title = '$configurationGroupTitle' ORDER BY configuration_group_id ASC;");
if ($configuration->EOF) {
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . "
(configuration_group_title, configuration_group_description, sort_order, visible)
VALUES ('$configurationGroupTitle', 'Set Affiliate Program Options', '1', '1');");
$configuration_group_id = $db->Insert_ID();
$db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = $configuration_group_id WHERE configuration_group_id = $configuration_group_id;");
} elseif ($configuration->RecordCount() != 1) {
$configuration_group_id = $configuration->fields['configuration_group_id'];
$db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_group_id = $configuration_group_id WHERE configuration_key LIKE 'SNAP%'");
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION_GROUP . " WHERE (configuration_group_id != $configuration_group_id AND configuration_group_title = '$configurationGroupTitle')");
} else {
$configuration_group_id = $configuration->fields['configuration_group_id'];
}
//-eof-v2.1.2c-Provide fix-up for problem with previous versions' auto-install
//-----
// If the currently-installed version of the plugin doesn't match the current install's
// version (or it's the first time) ...
//
// Loop through each of the configuration items, inserting them into the database if the
// previously-installed plugin version is less than this current install's version and
// the configuration key doesn't already exist (it "shouldn't", but this provides a bit of
// an additional safety net).
//
// Once that's complete, update the database configuration to the current install's version.
//
if (!defined('SNAP_MODULE_VERSION') || SNAP_MODULE_VERSION !== $currentVersion) { /*v2.1.2c*/
/*----
** This array contains the Configuration->Affiliate Program group's options. Each item will be entered with a
** last_modifed and date_added date of 'now()' by the foreach loop that follows. This structure allows new
** configuration items to be added without affecting the store's current setting for the newly-created items.
*/
$snap_config_items = array (
array ( 'version' => '1.1', 'title' => 'Module Version', 'key' => 'SNAP_MODULE_VERSION', 'value' => $currentVersion, 'description' => $currentDescription, 'sort_order' => 10, 'use_function' => 'NULL', 'set_function' => 'trim('),
array ( 'version' => '1.1', 'title' => 'Default Commission', 'key' => 'SNAP_DEFAULT_COMMISSION', 'value' => '0.1', 'description' => 'The default commission rate for your store\'s Affiliate Program. The value should be specified as a floating-point number in the range 0.0 to 1.0. The default value (<strong>0.1</strong>) represents a 10% commission rate.<br />', 'sort_order' => 12, 'use_function' => 'NULL', 'set_function' => 'NULL'),
array ( 'version' => '1.1', 'title' => 'Order Total Exclusions', 'key' => 'SNAP_ORDER_TOTALS_EXCLUSIONS', 'value' => 'ot_shipping,ot_tax', 'description' => 'Exclude these Order Totals classes from an affiliate\'s commission. Enter the values as a comma-separated list with no intervening blanks.<br /><br />Default: <b>ot_shipping,ot_tax</b>.', 'sort_order' => 14, 'use_function' => 'NULL', 'set_function' => 'NULL'),
array ( 'version' => '1.1', 'title' => 'Affiliate Key Prefix', 'key' => 'SNAP_KEY_PREFIX', 'value' => 'CNWR_', 'description' => 'Enter the prefix value to use for affiliate keys associated with your store\'s Affiliate Program. <strong>Note:</strong> If you change this value after you have started your program, existing affiliates will no longer earn their commissions!<br /><br />Default: <strong>CNWR_</strong>', 'sort_order' => 16, 'use_function' => 'NULL', 'set_function' => 'NULL'),
array ( 'version' => '1.1', 'title' => 'Send Affiliate Emails To', 'key' => 'SNAP_ADMIN_EMAIL', 'value' => 'Enter email address here', 'description' => 'Enter the email address to which affiliate-related sign-up emails should be sent.<br />', 'sort_order' => 18, 'use_function' => 'NULL', 'set_function' => 'NULL'),
array ( 'version' => '1.1', 'title' => 'Affiliate Program Images', 'key' => 'SNAP_AFFILIATE_IMAGES', 'value' => '', 'description' => 'Identify the images that your affiliates can use in their back-links. Each file must be present in your store\'s /images/referrers directory and be named <em>ref.ww.hh.ext</em> where <em>ww</em> is the image width, <em>hh</em> is the image height and <em>ext</em> is the image extension (gif or jpg).<br /><br />Use the format /ww,hh,ext/[ww,hh,ext/...] to identify the files. For example, if your store uses the files named ref.60.60.gif and ref.120.60.jpg for your program, you will enter this field as <b>/60,60,gif/120,60,jpg/</b><br />', 'sort_order' => 19, 'use_function' => 'NULL', 'set_function' => 'zen_cfg_textarea('),
array ( 'version' => '1.1', 'title' => 'Include in Information Sidebox?', 'key' => 'SNAP_INFORMATION_SIDEBOX', 'value' => 'true', 'description' => 'Identifies whether (\'true\') or not (\'false\') to include a link to your Affiliate Program in the Information sidebox.<br /><br />Default: <strong>\'true\'</strong>.', 'sort_order' => 20, 'use_function' => 'NULL', 'set_function' => 'zen_cfg_select_option(array(\'true\', \'false\'),'),
array ( 'version' => '2.1.0', 'title' => 'Affiliate Display Count', 'key' => 'SNAP_MAX_REFERRER_DISPLAY', 'value' => '50', 'description' => 'Specifies the maximum number of affiliates to show on each page of your admin\'s <em>Customers->Referrers</em>.<br /><br />Default: <strong>50</strong><br /><br />', 'sort_order' => 22, 'use_function' => 'NULL', 'set_function' => 'NULL'), /*v2.1.0a*/
array ( 'version' => '2.1.0', 'title' => 'Allow Self-Commissions', 'key' => 'SNAP_AFFILIATE_KEY_USE', 'value' => 'false', 'description' => 'Identifies whether (\'true\') or not (\'false\') an affiliate receives commission for purchases made using their own <em>affiliate key</em>.<br /><br />Default: <strong>\'false\'</strong>.', 'sort_order' => 24, 'use_function' => 'NULL', 'set_function' => 'zen_cfg_select_option(array(\'true\', \'false\'),'), /*v2.1.0a*/
array ( 'version' => '2.1.0', 'title' => 'Order Status Exclusions', 'key' => 'SNAP_ORDER_STATUS_EXCLUSIONS', 'value' => '', 'description' => 'Exclude orders with the following <em>Order Status</em> values from affiliate commissions. Specify the values as a packed (i.e. no spaces) comma-separated list.<br /><br />Default: <br /><br />', 'sort_order' => 26, 'use_function' => 'NULL', 'set_function' => 'NULL'), /*v2.1.0a*/
);
if (!defined('SNAP_MODULE_VERSION')) define ('SNAP_MODULE_VERSION', '0'); /*v2.1.2a*/
foreach ($snap_config_items as $config_item) {
if (SNAP_MODULE_VERSION < $config_item['version'] && !defined($config_item['key'])) {
$sql = "INSERT INTO " . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function)
VALUES
('" . $config_item['title'] . "', '" . zen_db_input($config_item['key']) . "', '" . zen_db_input($config_item['value']) . "', '" . zen_db_input($config_item['description']) . "', $configuration_group_id, " . (int)$config_item['sort_order'] . ", NOW(), NOW(), " . (($config_item['use_function'] == 'NULL') ? 'NULL' : ("'" . zen_db_input($config_item['use_function']) . "'")) . ', ' . (($config_item['set_function'] == 'NULL') ? 'NULL' : ("'" . zen_db_input($config_item['set_function']) . "'")) . ');';
$db->Execute($sql);
}
}
$db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = '$currentVersion', configuration_description = '$currentDescription' WHERE configuration_group_id = $configuration_group_id AND configuration_key = 'SNAP_MODULE_VERSION';");
unset($snap_config_items);
}
//----
// If the installation supports admin-page registration (i.e. v1.5.0 and later), then
// register the Affiliate Program configuration and the Referrers tool into the admin menu structure.
//
if (function_exists('zen_register_admin_page')) {
if (!zen_page_key_exists('configurationAffiliates')) {
zen_register_admin_page('configurationAffiliates', 'BOX_CONFIGURATION_AFFILIATES', 'FILENAME_CONFIGURATION', "gID=$configuration_group_id", 'configuration', 'Y', $configuration_group_id);
}
if (!zen_page_key_exists('customersReferrers')) {
zen_register_admin_page('customersReferrers', 'BOX_CUSTOMERS_REFERRERS', 'FILENAME_REFERRERS', '', 'customers', 'Y', 20);
}
}
I'll upload a v2.1.2 BUGFIX to the plugins area, probably tomorrow morning.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
When I'm on a roll, I'm on a roll ...
Let's try this version (2.1.2a) instead, since it actually works.:blush:
Code:
<?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');
}
define('SNAP_MODULE_CURRENT_VERSION', '2.1.2a'); /*v2.1.2c*/
define('SNAP_MODULE_UPDATE_DATE', '2013-04-09'); /*v2.1.2c*/
//----
// Create each of the database tables for the referrers plugin, if they don't already exist.
//
$sql = "CREATE TABLE IF NOT EXISTS " . TABLE_REFERRERS . " (
referrer_customers_id int(11) not null primary key,
referrer_key varchar(32) not null,
referrer_homepage text not null,
referrer_approved tinyint(4) not null,
referrer_banned tinyint(4) not null,
referrer_commission float not null
)";
$db->Execute($sql);
$sql = "CREATE TABLE IF NOT EXISTS " . TABLE_COMMISSION . " (
commission_orders_id int(11) not null primary key,
commission_referrer_key varchar(96) not null,
commission_rate float not null,
commission_paid datetime not null
)";
$db->Execute($sql);
//----
// Create the Configuration->Affiliate Program item, if it's not already there.
//
$configurationGroupTitle = 'Affiliate Program';
$currentVersion = SNAP_MODULE_CURRENT_VERSION;
$currentDescription = SNAP_MODULE_UPDATE_DATE . ', Vinos de Frutas Tropicales';
//-bof-v2.1.2c-Provide fix-up for problem with previous versions' auto-install
$configuration = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION_GROUP . " WHERE configuration_group_title = '$configurationGroupTitle' ORDER BY configuration_group_id ASC;");
if ($configuration->EOF) {
$db->Execute("INSERT INTO " . TABLE_CONFIGURATION_GROUP . "
(configuration_group_title, configuration_group_description, sort_order, visible)
VALUES ('$configurationGroupTitle', 'Set Affiliate Program Options', '1', '1');");
$configuration_group_id = $db->Insert_ID();
$db->Execute("UPDATE " . TABLE_CONFIGURATION_GROUP . " SET sort_order = $configuration_group_id WHERE configuration_group_id = $configuration_group_id;");
} elseif ($configuration->RecordCount() != 1) {
$configuration_group_id = $configuration->fields['configuration_group_id'];
$db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_group_id = $configuration_group_id WHERE configuration_key LIKE 'SNAP%'");
$db->Execute("DELETE FROM " . TABLE_CONFIGURATION_GROUP . " WHERE (configuration_group_id != $configuration_group_id AND configuration_group_title = '$configurationGroupTitle')");
} else {
$configuration_group_id = $configuration->fields['configuration_group_id'];
}
//-eof-v2.1.2c-Provide fix-up for problem with previous versions' auto-install
//-----
// If the currently-installed version of the plugin doesn't match the current install's
// version (or it's the first time) ...
//
// Loop through each of the configuration items, inserting them into the database if the
// previously-installed plugin version is less than this current install's version and
// the configuration key doesn't already exist (it "shouldn't", but this provides a bit of
// an additional safety net).
//
// Once that's complete, update the database configuration to the current install's version.
//
if (!defined('SNAP_MODULE_VERSION') || SNAP_MODULE_VERSION !== $currentVersion) { /*v2.1.2c*/
/*----
** This array contains the Configuration->Affiliate Program group's options. Each item will be entered with a
** last_modifed and date_added date of 'now()' by the foreach loop that follows. This structure allows new
** configuration items to be added without affecting the store's current setting for the newly-created items.
*/
$snap_config_items = array (
array ( 'version' => '1.1', 'title' => 'Module Version', 'key' => 'SNAP_MODULE_VERSION', 'value' => $currentVersion, 'description' => $currentDescription, 'sort_order' => 10, 'use_function' => 'NULL', 'set_function' => 'trim('),
array ( 'version' => '1.1', 'title' => 'Default Commission', 'key' => 'SNAP_DEFAULT_COMMISSION', 'value' => '0.1', 'description' => 'The default commission rate for your store\'s Affiliate Program. The value should be specified as a floating-point number in the range 0.0 to 1.0. The default value (<strong>0.1</strong>) represents a 10% commission rate.<br />', 'sort_order' => 12, 'use_function' => 'NULL', 'set_function' => 'NULL'),
array ( 'version' => '1.1', 'title' => 'Order Total Exclusions', 'key' => 'SNAP_ORDER_TOTALS_EXCLUSIONS', 'value' => 'ot_shipping,ot_tax', 'description' => 'Exclude these Order Totals classes from an affiliate\'s commission. Enter the values as a comma-separated list with no intervening blanks.<br /><br />Default: <b>ot_shipping,ot_tax</b>.', 'sort_order' => 14, 'use_function' => 'NULL', 'set_function' => 'NULL'),
array ( 'version' => '1.1', 'title' => 'Affiliate Key Prefix', 'key' => 'SNAP_KEY_PREFIX', 'value' => 'CNWR_', 'description' => 'Enter the prefix value to use for affiliate keys associated with your store\'s Affiliate Program. <strong>Note:</strong> If you change this value after you have started your program, existing affiliates will no longer earn their commissions!<br /><br />Default: <strong>CNWR_</strong>', 'sort_order' => 16, 'use_function' => 'NULL', 'set_function' => 'NULL'),
array ( 'version' => '1.1', 'title' => 'Send Affiliate Emails To', 'key' => 'SNAP_ADMIN_EMAIL', 'value' => 'Enter email address here', 'description' => 'Enter the email address to which affiliate-related sign-up emails should be sent.<br />', 'sort_order' => 18, 'use_function' => 'NULL', 'set_function' => 'NULL'),
array ( 'version' => '1.1', 'title' => 'Affiliate Program Images', 'key' => 'SNAP_AFFILIATE_IMAGES', 'value' => '', 'description' => 'Identify the images that your affiliates can use in their back-links. Each file must be present in your store\'s /images/referrers directory and be named <em>ref.ww.hh.ext</em> where <em>ww</em> is the image width, <em>hh</em> is the image height and <em>ext</em> is the image extension (gif or jpg).<br /><br />Use the format /ww,hh,ext/[ww,hh,ext/...] to identify the files. For example, if your store uses the files named ref.60.60.gif and ref.120.60.jpg for your program, you will enter this field as <b>/60,60,gif/120,60,jpg/</b><br />', 'sort_order' => 19, 'use_function' => 'NULL', 'set_function' => 'zen_cfg_textarea('),
array ( 'version' => '1.1', 'title' => 'Include in Information Sidebox?', 'key' => 'SNAP_INFORMATION_SIDEBOX', 'value' => 'true', 'description' => 'Identifies whether (\'true\') or not (\'false\') to include a link to your Affiliate Program in the Information sidebox.<br /><br />Default: <strong>\'true\'</strong>.', 'sort_order' => 20, 'use_function' => 'NULL', 'set_function' => 'zen_cfg_select_option(array(\'true\', \'false\'),'),
array ( 'version' => '2.1.0', 'title' => 'Affiliate Display Count', 'key' => 'SNAP_MAX_REFERRER_DISPLAY', 'value' => '50', 'description' => 'Specifies the maximum number of affiliates to show on each page of your admin\'s <em>Customers->Referrers</em>.<br /><br />Default: <strong>50</strong><br /><br />', 'sort_order' => 22, 'use_function' => 'NULL', 'set_function' => 'NULL'), /*v2.1.0a*/
array ( 'version' => '2.1.0', 'title' => 'Allow Self-Commissions', 'key' => 'SNAP_AFFILIATE_KEY_USE', 'value' => 'false', 'description' => 'Identifies whether (\'true\') or not (\'false\') an affiliate receives commission for purchases made using their own <em>affiliate key</em>.<br /><br />Default: <strong>\'false\'</strong>.', 'sort_order' => 24, 'use_function' => 'NULL', 'set_function' => 'zen_cfg_select_option(array(\'true\', \'false\'),'), /*v2.1.0a*/
array ( 'version' => '2.1.0', 'title' => 'Order Status Exclusions', 'key' => 'SNAP_ORDER_STATUS_EXCLUSIONS', 'value' => '', 'description' => 'Exclude orders with the following <em>Order Status</em> values from affiliate commissions. Specify the values as a packed (i.e. no spaces) comma-separated list.<br /><br />Default: <br /><br />', 'sort_order' => 26, 'use_function' => 'NULL', 'set_function' => 'NULL'), /*v2.1.0a*/
);
$installedVersion = (defined('SNAP_MODULE_VERSION')) ? SNAP_MODULE_VERSION : '0'; /*v2.1.2c*/
foreach ($snap_config_items as $config_item) {
if ($installedVersion < $config_item['version'] && !defined($config_item['key'])) { /*v2.1.2c*/
$sql = "INSERT INTO " . TABLE_CONFIGURATION . "
(configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function)
VALUES
('" . $config_item['title'] . "', '" . zen_db_input($config_item['key']) . "', '" . zen_db_input($config_item['value']) . "', '" . zen_db_input($config_item['description']) . "', $configuration_group_id, " . (int)$config_item['sort_order'] . ", NOW(), NOW(), " . (($config_item['use_function'] == 'NULL') ? 'NULL' : ("'" . zen_db_input($config_item['use_function']) . "'")) . ', ' . (($config_item['set_function'] == 'NULL') ? 'NULL' : ("'" . zen_db_input($config_item['set_function']) . "'")) . ');';
$db->Execute($sql);
}
}
$db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = '$currentVersion', configuration_description = '$currentDescription' WHERE configuration_group_id = $configuration_group_id AND configuration_key = 'SNAP_MODULE_VERSION';");
unset($snap_config_items);
}
//----
// If the installation supports admin-page registration (i.e. v1.5.0 and later), then
// register the Affiliate Program configuration and the Referrers tool into the admin menu structure.
//
if (function_exists('zen_register_admin_page')) {
if (!zen_page_key_exists('configurationAffiliates')) {
zen_register_admin_page('configurationAffiliates', 'BOX_CONFIGURATION_AFFILIATES', 'FILENAME_CONFIGURATION', "gID=$configuration_group_id", 'configuration', 'Y', $configuration_group_id);
}
if (!zen_page_key_exists('customersReferrers')) {
zen_register_admin_page('customersReferrers', 'BOX_CUSTOMERS_REFERRERS', 'FILENAME_REFERRERS', '', 'customers', 'Y', 20);
}
}
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Hello,
I wish to install the SNAP Affiliates and use it for 1.3.9h but what i wanted to know was:
a) Can you create a tiered structure so that people earn different stages of commission if they sell more? (sell 10 get 5%, sell 20 get 10%, sell 30 get 12.5% etc...)
b) Can you limit the programme for use with certain items only?
c) Will the 1.5 version work for me?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
christospur
Hello,
I wish to install the SNAP Affiliates and use it for 1.3.9h but what i wanted to know was:
a) Can you create a tiered structure so that people earn different stages of commission if they sell more? (sell 10 get 5%, sell 20 get 10%, sell 30 get 12.5% etc...)
b) Can you limit the programme for use with certain items only?
c) Will the 1.5 version work for me?
the 1.5 version isn't built to work on 1.3
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
christospur
Hello,
I wish to install the SNAP Affiliates and use it for 1.3.9h but what i wanted to know was:
a) Can you create a tiered structure so that people earn different stages of commission if they sell more? (sell 10 get 5%, sell 20 get 10%, sell 30 get 12.5% etc...)
b) Can you limit the programme for use with certain items only?
c) Will the 1.5 version work for me?
christospur, the answers to all your questions are (at this time): No.
Other people have requested your item (b) to limit the program only to certain items or, alternatively, to exclude some items from commission. I don't think I have heard the request to have a tiered structure before -- either based on number of items or using a sales-amount threshold -- but if others would like this I can place it on the things-to-do list.
As picandnix indicated, this version will not work on the 1.3.x versions of Zen Cart.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
The original Snap Affiliates by Michael, seems to allow for it to be limited to individual items:
"Affiliates can link anywhere into your Zen Cart store and still receive credit for sales; from the front page down to individual items."
It also seemed to allow for variable commission rates:
"Variable commission rates; a valuable tool for motivating and rewarding affiliates."
In working practise, is this not the case?
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
christospur
The original Snap Affiliates by Michael, seems to allow for it to be limited to individual items:
"Affiliates can link anywhere into your Zen Cart store and still receive credit for sales; from the front page down to individual items."
It also seemed to allow for variable commission rates:
"Variable commission rates; a valuable tool for motivating and rewarding affiliates."
In working practise, is this not the case?
christospur, the key phrase is seems to.
The first phrase you quoted would be better written: "Affiliates can link anywhere into your Zen Cart store, from the front page down to individual items, and still receive credit for sales.". Neither version of the plugin limits the commission earned by an affiliate to individual items.
I believe that the "variable commission rates" that are quoted in the description for this plugin's parent refer to the fact that you can vary the commission rates from one affiliate to the other. A specific affiliate's commission rate, however, is fixed; it does not vary from one product to the next.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
i can not see affiliate link even after saying yes in admin settings to include on information box.
everything else is working but have no link?
see http://www.pokerlifegear.com/shop
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
Leif Oskarsson
i can not see affiliate link even after saying yes in admin settings to include on information box.
everything else is working but have no link?
see
http://www.pokerlifegear.com/shop
Did you rename the file folder /includes/modules/sideboxes/YOUR_TEMPLATE/information.php to /includes/modules/robbor_black/information.php?
There are a bunch of template overrides in this plugin and it's very easy to miss one ...
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I wonder if anyone can help.
I'm using the latest version of this plugin on zencart 1.5 with ceons ultimate seo and while I get no 404 errors and the cookie seems to be set, I'm not getting any record of affiliate commissions. I've check and the version I have installed is the one with the amended files for seo plugins on this thread.
I'm using Nochex (payment processor) to test my transactions and the sales are being recorded, just not the affiliate commission. I've cleared the cookies and use a different account to make the purchase from the referral link, tried home page and deep links. Nothing seems to work.
Any suggestions?
Many thanks
Kerrie
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
kezan98
I wonder if anyone can help.
I'm using the latest version of this plugin on zencart 1.5 with ceons ultimate seo and while I get no 404 errors and the cookie seems to be set, I'm not getting any record of affiliate commissions. I've check and the version I have installed is the one with the amended files for seo plugins on this thread.
I'm using Nochex (payment processor) to test my transactions and the sales are being recorded, just not the affiliate commission. I've cleared the cookies and use a different account to make the purchase from the referral link, tried home page and deep links. Nothing seems to work.
Any suggestions?
Many thanks
Kerrie
Hi Kerrie
have you read all of this thread? I think it's been answered already.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Hmm, I thought I'd replied but it seems to have disappeared, apologies if it it reappears somewhere.
The only thing I could find in this thread relates to the code that's changed to make the mod work with seo mods. I've already double checked the code and it's the same as the code in the latest download.
Is there something else I've missed?
I'd love to get this working as I tried jrox a few months ago and couldn't get that to work either.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
kezan98
Hmm, I thought I'd replied but it seems to have disappeared, apologies if it it reappears somewhere.
The only thing I could find in this thread relates to the code that's changed to make the mod work with seo mods. I've already double checked the code and it's the same as the code in the latest download.
Is there something else I've missed?
I'd love to get this working as I tried jrox a few months ago and couldn't get that to work either.
Its ok, I put a real order through with paypal and it seems to be working now.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
kezan98
I wonder if anyone can help.
I'm using the latest version of this plugin on zencart 1.5 with ceons ultimate seo
Kerrie can you clarify which 'seo' mod you are using please?
Ceon uri rewrite or ultimate seo?
-
1 Attachment(s)
Re: Snap Affiliates v2.0 for v1.5.0 and later
I understand the issues between this plug-in and an SEO, but I do not use one. I am looking at changing the following to read to my site.
Gifts For All Occasions At GiftaDoodle.com
<a href="http://novelties.lingeriensuch.ca/index.php?main_page=index&referrer=CNWR_11369602709">Gifts For All Occasions At novelties.lingeriensuch.ca</a>
This can be found at my site link http://novelties.lingeriensuch.ca/in...referrer_tools
Attachment 12560
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Edit /includes/languages/english/YOUR_TEMPLATE/referrer_tools.php, line 23:
Code:
define('TEXT_MARKETING_TEXT', 'Gifts For All Occasions At GiftaDoodle.com');
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I'm not sure if I did something wrong but I installed the mod using an ftp and it all seemed to have gone right. I changed the admin folder to match mine and uploaded but I'm missing the affiliate link in the information sidebox, is this a bug? Did we need to rename the YOUR_TEMPLATE folder?
I'm using Snap 2.1.2a and Zencart 1.5.1 with Windows XP
Cheers
Robert
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
My bad, I found the answer on page 6, you're supposed to change the YOUR_TEMPLATE to the template you're using. For me, it's classic.
Cheers
Robert
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
This time, I looked before I asked. I got that link to appear in the information sidebox but it's says "BOX_INFORMATION_REFERRER_TERMS". How do I go about changing this title to what I need. I tried in one file but it caused a weird template error.
Cheers
Robert
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
arcanesanctuary
This time, I looked before I asked. I got that link to appear in the information sidebox but it's says "
BOX_INFORMATION_REFERRER_TERMS". How do I go about changing this title to what I need. I tried in one file but it caused a weird template error.
Cheers
Robert
You're missing a language file or have a part uploaded file. Compare the content of the zip file to the files on your server, or simply re-upload and overwrite.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
picandnix
You're missing a language file or have a part uploaded file. Compare the content of the zip file to the files on your server, or simply re-upload and overwrite.
... or you missed one of the five (5) YOUR_TEMPLATE directory renames; the language constant is defined in /includes/languages/english/extra_definitions/YOUR_TEMPLATE/snap_affiliates.php
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
lat9
... or you missed one of the five (5) YOUR_TEMPLATE directory renames; the language constant is defined in /includes/languages/english/extra_definitions/YOUR_TEMPLATE/snap_affiliates.php
And that of course, dur :wink:
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I've uploaded v2.2.0 of this plugin for your continued enjoyment :smile:; it moves the configuration of the "Cookie Lifetime" into an admin-configured setting so there are no more file edits required! Also beefed up the readme to specifically identify the various (5 of them) YOUR_TEMPLATE directories that need renaming for proper operation.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
lat9
it moves the configuration of the "Cookie Lifetime" into an admin-configured setting so there are no more file edits required!
Very clever, thank you Lat9.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
You were absolutely right. There were a couple files not in the right position.
Cheers
Robert
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
arcanesanctuary
You were absolutely right. There were a couple files not in the right position.
Cheers
Robert
I'm glad you got it sorted out!
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
One last question, isn't there supposed to be an sql patch for the program? I remember there being one in the last version before you took it over.
Cheers
Robert
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Robert, the SQL patching is all done automatically via the file /YOUR_ADMIN/includes/functions/extra_functions/init_snap.php. That file adds the necessary database tables as well as the configuration fields controlled by Configuration->Affiliate Program.
There's a SQL patch to remove the stuff that's added ...
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
It's amazing how much you've improved this module from the original script. Thank you.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Thanks for the compliment:blush:; I'm glad you're enjoying it!
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
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/ref...ef.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:
Code:
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 ...
-
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! :)
-
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!!
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
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!
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
I've submitted v2.3.0 to the plugins area:
- Starting with this version, there is one core-file overwrite.
- 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.
- 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
- BUGFIX: When using the affiliate banners, the image-link produced was relative instead of absolute so it didn't reference the actual store.
- Added "Purchases Per Cookie" configuration variable
-
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
-
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
-
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.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
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.
Quote:
Originally Posted by
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:
Code:
<?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
}
}
}
Quote:
Originally Posted by
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.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
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
- (2.3.0) 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.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
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.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
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.
-
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:
- BUGFIX: Didn't include the updated version of /includes/classes/observers/class.snap_order_observer.php in the v2.3.0 distribution!
- BUGFIX: Corrected files changed for this version to properly reflect the template file that was changed.
- BUGFIX: Completed partially-completed referrer_edit page processing.
-
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.
- (2.4.0) 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
-
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 http://www.mysite.com/index.php?main..._REFERRER_EDIT
Have I missed something? I followed the 2.3>2.4 upgrade methods.
No error Logs generated.
-
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!
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
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:
-
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.
-
Re: Snap Affiliates v2.0 for v1.5.0 and later
Quote:
Originally Posted by
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.
-
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.