Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC-Affiliate


henri

Recommended Posts

Okay, new bug/problem.

 

The click count on affiliate_clicks.php stretches my web site really wide, about 1300 width.

 

It is because some of the refferal URL have a long url like this:

 

http://www.google.ca/search?hl=en&safe...ard&spell=1

 

How ca I get this so it doesn't go so long?

 

I tried changing the tables from 100% to just 100 to see if it will, but to no avail.

 

Thanks.

Link to comment
Share on other sites

I have been using this contrib with great success, however I have some problems and I need some help. With regards to affiliate billing (payment) I am trying to get the system to read all orders that are at least 30 days old and have not been paid.

 

Problem 1: The problem lies in the timeline for compiling invoice data. If it takes more than 1 year to reach a commission level, it simply leaves out those orders over 1 year old. I think this code in the admin/affiliates_payment file has something to do with it:

 

// We are only billing orders which are AFFILIATE_BILLING_TIME days old
  $time = mktime(1, 1, 1, date("m"), date("d") - AFFILIATE_BILLING_TIME, date("Y"));

 

If the above code is the controlling factor, what do I change it to?

 

Problem 2: Eliminating orders that have the same name as the affiliate. I don't pay my affiliates for buying products using their own affiliate link.

 

Problem 3: When an order is deleted in the Customers Order admin section, it should remove the affiliate sale and commission from the list (database).

 

I know this is a tall order, but if anyone has a fix, please let me know where I can find them or what to change.

 

Many thanks,

Tom

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

I have been using this contrib with great success, however I have some problems and I need some help. With regards to affiliate billing (payment) I am trying to get the system to read all orders that are at least 30 days old and have not been paid.

 

Problem 1: The problem lies in the timeline for compiling invoice data. If it takes more than 1 year to reach a commission level, it simply leaves out those orders over 1 year old. I think this code in the admin/affiliates_payment file has something to do with it:

 

// We are only billing orders which are AFFILIATE_BILLING_TIME days old
  $time = mktime(1, 1, 1, date("m"), date("d") - AFFILIATE_BILLING_TIME, date("Y"));

 

If the above code is the controlling factor, what do I change it to?

 

Problem 2: Eliminating orders that have the same name as the affiliate. I don't pay my affiliates for buying products using their own affiliate link.

 

Problem 3: When an order is deleted in the Customers Order admin section, it should remove the affiliate sale and commission from the list (database).

 

I know this is a tall order, but if anyone has a fix, please let me know where I can find them or what to change.

 

Many thanks,

Tom

 

Problem 3 can be rectified if you change the configuration in admin/includes/affiliate_configure.php to "true" for remove deleted orders.

Problem 1 may also be fixed in the same file...or maybe setup a affiliate rule that all commissions not meeting the min will not be paid after 1 year?

Link to comment
Share on other sites

I agree with stickypod on problem #2 & 3!

"Problem 2: Eliminating orders that have the same name as the affiliate. I don't pay my affiliates for buying products using their own affiliate link."

 

Any progress on resolving this?

 

Jon

Link to comment
Share on other sites

New bug /problem and I'm stumped:

 

I've installed OSCommerce 2.2 M2 with no problem

I've installed OSC Affiliate version 2.8 (12/9/2007)

and made all the necessary insertions and have triple checked them

 

The only problem I'm having is when I'm logged into my affiliate account

and am trying to edit my affiliate details with the file

catalog/affiliate_details.php

I get "51" displayed on my screen and nothing else and no other errors

 

The affiliate_summary.php, affiliate_password.php, etc all work fine

 

I've also checked to make sure that I have

catalog/includes/languages/english/affiliate_details.php

and it's there and appears to be ok

 

 

Does anyone have any advice ?

 

Thanks so much,

Janet

 

I've also since looked at some others who have theirs working ok, and they have an

osCsid in their file, so it would look like

affiliate_details.php?osCsid=f20f5bb5c7e2a67a41a76994d6856dc8

 

Mine doesn't have the osCsid in it - is that the problem ?

Edited by janetmon
Link to comment
Share on other sites

I have some additional scenarios:

 

I completely deleted catalog/includes/modules/affiliate_account_details.php

to see what would happen.

 

The page loaded fine with my headers and titles and columns displayed until

I got the error that /modules/affiliate_account_details.php didn't exist

 

When I put it back, though, I get a blank screen with "51" displayed.

 

So if you have any advice, I'd appreciate it.

 

Thanks,

Janet

Link to comment
Share on other sites

I have some additional scenarios:

 

I completely deleted catalog/includes/modules/affiliate_account_details.php

to see what would happen.

 

The page loaded fine with my headers and titles and columns displayed until

I got the error that /modules/affiliate_account_details.php didn't exist

 

When I put it back, though, I get a blank screen with "51" displayed.

 

So if you have any advice, I'd appreciate it.

 

Thanks,

Janet

 

You get a blank screen with just a number 51 listed? No error message?

 

Did you check your error log file?

Link to comment
Share on other sites

Yes, there was no error message. I've contacted my host provider to see if they

could check the error logs, and they can't provide me any details.

 

I have tried some other options to see what would happen:

 

- in catalog/affiliate_details.php script, I changed the

require(DIR_WS_MODULES . 'affiliate_account_details.php');

to

require(DIR_WS_MODULES . 'address_book_details.php');

and it ran fine

 

- then changed

require(DIR_WS_MODULES . 'affiliate_account_details.php');

to

require(DIR_WS_MODULES . 'affiliate_signup_details.php');

and got the same "51" displaying on the screen with no other error messages

 

Thanks,

Janet

Link to comment
Share on other sites

I have it narrowed down and I know where the problem is but don't know

how to fix it.

 

In catalog/includes/boxes/affiliate.php

 

if (tep_session_is_registered('affiliate_id')) {

 

doesn't work and I get "51" displayed

 

If I change it to

 

if (!tep_session_is_registered('affiliate_id')) {

 

then the page displays fine

 

The only problem is that my array of affiliate options

(summary, change password, etc, etc) doesn't show

 

Any advice ?

 

Thanks again,

Janet

Link to comment
Share on other sites

Problem 3 can be rectified if you change the configuration in admin/includes/affiliate_configure.php to "true" for remove deleted orders.

Problem 1 may also be fixed in the same file...or maybe setup a affiliate rule that all commissions not meeting the min will not be paid after 1 year?

Thank you for the heads up on the affiliate configure. I never setup that file when I installed.

 

Problem 3: I won't know until I delete an affiliate sale whether or not this worked.

Problem 1: I don't see a definition in the configure file for this. Would you please send me the coding from your file or let me know which version you're using?

Problem 2: Still unresolved. I simply put this rule into my affiliate agreement. It's not going to be an easy fix.

 

Thanks for the help.

Tom

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

I have it narrowed down and I know where the problem is but don't know

how to fix it.

 

In catalog/includes/boxes/affiliate.php

 

if (tep_session_is_registered('affiliate_id')) {

 

doesn't work and I get "51" displayed

 

If I change it to

 

if (!tep_session_is_registered('affiliate_id')) {

 

then the page displays fine

 

The only problem is that my array of affiliate options

(summary, change password, etc, etc) doesn't show

 

Any advice ?

 

Thanks again,

Janet

 

if (tep_session_is_registered('affiliate_id')) {

 

Is what is in my affiliate.php file. here's the entire affiliate.php from my site.. maybe compare this to yours? I'm using v 2.61, as I didn't like the ones afterwards seemed confusing to me, and the 2.6 seemed the one that looked like it was stable the longest.

 

<?php
/*
 $Id: affiliate.php,v 2.00 2003/10/12

 OSC-Affiliate

 Contribution based on:

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 - 2003 osCommerce

 Released under the GNU General Public License
*/
?>		  
<tr>
		<td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
						   'text'  => BOX_HEADING_AFFILIATE
						  );
 new infoBoxHeading($info_box_contents, false, false);

 if (tep_session_is_registered('affiliate_id')) {
$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',
							 'text'  => '<b><a href="' . tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL') . '">' . BOX_AFFILIATE_SUMMARY . '</a></b><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_ACCOUNT, '', 'SSL') . '">' . BOX_AFFILIATE_ACCOUNT . '</a><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_PASSWORD, '', 'SSL') . '">' . BOX_AFFILIATE_PASSWORD . '</a><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWSLETTER, '', 'SSL') . '">' . BOX_AFFILIATE_NEWSLETTER . '</a><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_NEWS, '', 'SSL') . '">' . BOX_AFFILIATE_NEWS . '</a><br>' .
										'<b><a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS, '', 'SSL') . '">' . BOX_AFFILIATE_BANNERS . '</a></b><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BANNERS, '', 'SSL') . '">' . BOX_AFFILIATE_BANNERS_BANNERS . '</a><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, '', 'SSL') . '">' . BOX_AFFILIATE_BANNERS_BUILD . '</a><br>' .
'  <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD_CAT, '', 'SSL') . '">' . BOX_AFFILIATE_BANNERS_BUILD_CAT . '</a><br>' .
'  <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_CATEGORY, '', 'SSL') . '">' . BOX_AFFILIATE_BANNERS_CATEGORY . '</a><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_PRODUCT, '', 'SSL') . '">' . BOX_AFFILIATE_BANNERS_PRODUCT . '</a><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_TEXT, '', 'SSL') . '">' . BOX_AFFILIATE_BANNERS_TEXT . '</a><br>' .
										'<b><a href="' . tep_href_link(FILENAME_AFFILIATE_REPORTS, '', 'SSL') . '">' . BOX_AFFILIATE_REPORTS . '</a></b><br>' .
										  '  <a href="' . tep_href_link(FILENAME_AFFILIATE_CLICKS, '', 'SSL'). '">' . BOX_AFFILIATE_CLICKRATE . '</a><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_SALES, '', 'SSL'). '">' . BOX_AFFILIATE_SALES . '</a><br>' .
										'  <a href="' . tep_href_link(FILENAME_AFFILIATE_PAYMENT, '', 'SSL'). '">' . BOX_AFFILIATE_PAYMENT . '</a><br>' .
										'<a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT, '', 'SSL') . '">' . BOX_AFFILIATE_CONTACT . '</a><br>' .
										'<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ, '', 'SSL') . '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
										'<a href="' . tep_href_link(FILENAME_AFFILIATE_LOGOUT). '">' . BOX_AFFILIATE_LOGOUT . '</a>');

new infoBox($info_box_contents);
 } else {
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
							 'text'  => '<a href="' . tep_href_link(FILENAME_AFFILIATE_INFO, '', 'NONSSL'). '">' . BOX_AFFILIATE_INFO . '</a><br>' .
										'<a href="' . tep_href_link(FILENAME_AFFILIATE_FAQ, '', 'NONSSL') . '">' . BOX_AFFILIATE_FAQ . '</a><br>' .
										'<a href="' . tep_href_link(FILENAME_AFFILIATE, '', 'SSL') . '">' . BOX_AFFILIATE_LOGIN . '</a>'
							);
new infoBox($info_box_contents);
 }
?>
		</td>
	  </tr>

Link to comment
Share on other sites

Thank you for the heads up on the affiliate configure. I never setup that file when I installed.

 

Problem 3: I won't know until I delete an affiliate sale whether or not this worked.

Problem 1: I don't see a definition in the configure file for this. Would you please send me the coding from your file or let me know which version you're using?

Problem 2: Still unresolved. I simply put this rule into my affiliate agreement. It's not going to be an easy fix.

 

Thanks for the help.

Tom

 

I am sorry... I misspoke about problem #1... there is not setting for this, that I can see. I'll change the date in one of my test orders to 1 year ago and see if I have the same problem.

Link to comment
Share on other sites

Thank you for the heads up on the affiliate configure. I never setup that file when I installed.

 

Problem 3: I won't know until I delete an affiliate sale whether or not this worked.

Problem 1: I don't see a definition in the configure file for this. Would you please send me the coding from your file or let me know which version you're using?

Problem 2: Still unresolved. I simply put this rule into my affiliate agreement. It's not going to be an easy fix.

 

Thanks for the help.

Tom

 

Tom, I checked in the affiliate database, and changed the date the affiliate sale came in on my web site to 03/07/07, and then clicked to create payment, and it did...

 

I changed the date in the affiliate_sales table, and the affiliate_date field within the table.

 

I could not find a data field with the name that you quoted in the code.

Link to comment
Share on other sites

Thanks so much for trying to help. The version

$Id: affiliate.php,v 2.00 2003/10/12

is the same one I had, but I reloaded it anyway.

Same "51" problem.....

 

Thanks,

Janet

 

Not sure what to tell you. I installed 2.6X and it's worked fine for me... no issues at all.

Link to comment
Share on other sites

hi guys, i got a question here and have tried to search the forum but got no answer.

just want to know, if a customer was refered to my site bbb.com from an affiliate aaa.com, will all of his orders be counted in 30 days? even if he don't go to aaa.com again?

 

and what will happen if he keep being referred by aaa.com?

 

Thank you very much in advance if someone can give me an answer.

Link to comment
Share on other sites

Tom, I checked in the affiliate database, and changed the date the affiliate sale came in on my web site to 03/07/07, and then clicked to create payment, and it did...

 

I changed the date in the affiliate_sales table, and the affiliate_date field within the table.

 

I could not find a data field with the name that you quoted in the code.

The AFFILIATE_BILLING_TIME is part of your store configuration table in the MySQL database. The data field is titled "Billing Time". However, this is not the problem. The problem is with the first half of this line:

$time = mktime(1, 1, 1, date("m"), date("d") - AFFILIATE_BILLING_TIME, date("Y"));
  $oldday = date("Y-m-d", $time);

 

If we can setup this code so the time extends back say 5 years, then it will work fine. Once the affiliate is paid, it removes any old sales from the timeline and everything will work fine.

 

If anyone knows how to do this, please update the line above or let me know if I'm completely off base.

 

Many thanks,

Tom

Anyone can buy a camera... it's what you do with it that counts!

Sticky Pod

www.stickypod.com

Link to comment
Share on other sites

The AFFILIATE_BILLING_TIME is part of your store configuration table in the MySQL database. The data field is titled "Billing Time". However, this is not the problem. The problem is with the first half of this line:

$time = mktime(1, 1, 1, date("m"), date("d") - AFFILIATE_BILLING_TIME, date("Y"));
  $oldday = date("Y-m-d", $time);

 

If we can setup this code so the time extends back say 5 years, then it will work fine. Once the affiliate is paid, it removes any old sales from the timeline and everything will work fine.

 

If anyone knows how to do this, please update the line above or let me know if I'm completely off base.

 

Many thanks,

Tom

 

tom, I may be sticking my foot in my mouth, because I am no expert, maybe someone else can chime in, but this thread after 2000+ posts seems somewhat quiet.

 

Anywho, the way I see it, the Affiliate_Billing_Time is the amount of days you set up in configuration before a commissioned sale is paid commission. I think that you are focused on is calculating out into the future WHEN that commission would be payable.

 

INSERT INTO configuration VALUES ('','Billing Time', 'AFFILIATE_BILLING_TIME', '30', 'Orders billed must be at least "30" days old.<br>This is needed if a order is refunded', 900, 5, NULL, now(), NULL, NULL);

 

But then again, I may be way off... where in the database are these dates stored? They have to be in the database somewhere. I assumed they were in the clump of affiliate tables.

Link to comment
Share on other sites

It seems that the coding you refer to is creating a date that is today less the affiliate billing time:

 

	  $time = mktime(1, 1, 1, date("m"), date("d") - AFFILIATE_BILLING_TIME, date("Y"));
  $oldday = date("Y-m-d", $time);

 

And then this code that actually pulls the sales that qualify, comparing the above date, is it less than or equal to the "affiliate date"

 

/ Get all orders which are AFFILIATE_BILLING_TIME days old
	$sql="
	SELECT a.affiliate_orders_id 
	  FROM " . TABLE_AFFILIATE_SALES . " a, " . TABLE_ORDERS . " o 
	  WHERE a.affiliate_billing_status!=1 and a.affiliate_orders_id=o.orders_id and o.orders_status>=" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and a.affiliate_id='" . $affiliate_payment['affiliate_id'] . "'and a.affiliate_date <= '" . $oldday . "'
	";
	$affiliate_orders_query=tep_db_query ($sql);
	$orders_id ="(";
	while ($affiliate_orders = tep_db_fetch_array($affiliate_orders_query)) {
	  $orders_id .= $affiliate_orders['affiliate_orders_id'] . ",";
	}
	$orders_id = substr($orders_id, 0, -1) .")";

Edited by varnco
Link to comment
Share on other sites

I found the solution to my problem with affiliate_details.php

 

If I have more than 100 countries listed in the dropdown box, I will

get the "51" error.

 

I have no idea why (since affiliate_signup.php works fine)

but at least it works correctly if I keep my countries database

reduced size.

 

Thanks,

Janet

Link to comment
Share on other sites

hi guys, i got a question here and have tried to search the forum but got no answer.

just want to know, if a customer was refered to my site bbb.com from an affiliate aaa.com, will all of his orders be counted in 30 days? even if he don't go to aaa.com again?

 

and what will happen if he keep being referred by aaa.com?

 

Thank you very much in advance if someone can give me an answer.

 

You set the cookie time for the referral, under configuration for the affiliate program contribution

 

If, you have the cookie set for 30 days, then yes, if the customer returns again to your site within the 30 days then the affiliate will get credit for the sale.

 

The cookie is reset for a new 30 day time the next time the customer is referred by the link from aaa.com

 

I plan on setting my cookie for 7 days... 30 seems too long.

Link to comment
Share on other sites

We are considering setting up osCAffiliate, but wanted to know if there is a way to set commissions per product rather than a flat percentage? Also, is there a way to exclude a product from the affiliate program?

 

I tried a google search but it didn't seem to find this info - so if I've missed it I apologize.

 

TIA

:D

~Tracy
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...