Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC-Affiliate


henri

Recommended Posts

tried that no joy, I think I am going to have to bite the bullet and upgrade to a later revision, which is the best version as i see in this thread loads of comments and issues

Link to comment
Share on other sites

tried that no joy, I think I am going to have to bite the bullet and upgrade to a later revision, which is the best version as i see in this thread loads of comments and issues

 

Sorry there was a misunderstanding in your question for me. The affiliate appplication top only evaluates the incoming links

but dont generates them.

 

In your case, it seems that the generated link code isnt correct. This may have two reasons.

1. your admin/affiliate_banners.php has wrong code snippets for categorys within

2. your catalog/affiliate_banners_category (or build) doesnt work correct.

 

Does it happens while you arrange some special banenrs to categories in the admin panel ?

Link to comment
Share on other sites

what does a category specific banner link format look like ordinarily then ?

 

i.e. mine has index.php?ref=14&affiliate_banner_id=4 in it, what should it have for a category ?

Link to comment
Share on other sites

what does a category specific banner link format look like ordinarily then ?

 

i.e. mine has index.php?ref=14&affiliate_banner_id=4 in it, what should it have for a category ?

 

index.php?ref=3&cPath=34&affiliate_banner_id=13 for example should be the right one for a category

and

product_info.php?ref=3&products_id=28&affiliate_banner_id=1 should be the right one for a product link

Link to comment
Share on other sites

Hi

 

I'm just trying to set up v2.6 on oSC 2.2 Milestone 2, the admin side appears to be set up ok apart from it not uploading a new banner to the images directory. It saves the settings but not the image.

 

Also when I fill in the sign up page for a new affiliate it won't let me go any further, it just keeps showing the filled in form.

 

I am not getting any error messages and I have looked through this thread but cannot come up with an answer.

 

Has anybody got any suggestions?

 

Regards

 

Mike

 

PLease check for Adding two lines at the file affiliate_signup.php:

 

$a_confirmation = tep_db_prepare_input($HTTP_POST_VARS['a_confirmation']);
$a_agb = tep_db_prepare_input($HTTP_POST_VARS['a_agb']);

Link to comment
Share on other sites

index.php?ref=3&cPath=34&affiliate_banner_id=13 for example should be the right one for a category

 

hmm ok so the cpath is missing from the banner code and hence why it sticks at start root page instead of going to the right category,

now where is that cpath variable appended into the url for the banners ?

 

I think it might be because I use STS template contrib

 

i.e. my build a link page for affiliates is from the affiliate_banners.php page (code below):

 

<?php

/*

 $Id: affiliate_banners.php,v 1.1.1.1 2005/01/15 06:43:44 Michael Sasek Exp $



 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

*/



 require('includes/application_top.php');



 if (!tep_session_is_registered('affiliate_id')) {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));

 }



 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_AFFILIATE_BANNERS);



 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_AFFILIATE_BANNERS));



 $affiliate_banners_values = tep_db_query("select * from " . TABLE_AFFILIATE_BANNERS . " order by affiliate_banners_title");



 $content = affiliate_banners; 



 require(DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE);



 require(DIR_WS_INCLUDES . 'application_bottom.php'); 

?>

 

and then the relevant tpl file code is as follows:-

 

	 <table border="0" width="100%" cellspacing="0" cellpadding="<?php echo CELLPADDING_SUB; ?>"> 
  <tr> 
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	  <tr>
		<td class="main" colspan=2><?php echo TEXT_INFORMATION; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table width="100%" border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER . ' ' . $affiliate_banners['affiliate_banners_title']; ?></td>
	  </tr>
	  <tr>
		<td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INDIVIDUAL_BANNER_INFO . tep_draw_form('individual_banner', tep_href_link(FILENAME_AFFILIATE_BANNERS) ) . "\n" . tep_draw_input_field('individual_banner_id', '', 'size="5"') . "  " . tep_image_submit('button_affiliate_build_a_link.gif', IMAGE_BUTTON_BUILD_A_LINK); ?></form></td>
	  </tr>
<?php
 if (tep_not_null($HTTP_POST_VARS['individual_banner_id']) || tep_not_null($HTTP_GET_VARS['individual_banner_id'])) {

if (tep_not_null($HTTP_POST_VARS['individual_banner_id'])) $individual_banner_id = $HTTP_POST_VARS['individual_banner_id'];
if ($HTTP_GET_VARS['individual_banner_id']) $individual_banner_id = $HTTP_GET_VARS['individual_banner_id'];
$affiliate_pbanners_values = tep_db_query("select p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $individual_banner_id . "' and pd.products_id = '" . $individual_banner_id . "' and p.products_status = '1' and pd.language_id = '" . $languages_id . "'");
if ($affiliate_pbanners = tep_db_fetch_array($affiliate_pbanners_values)) {
  switch (AFFILIATE_KIND_OF_BANNERS) {
	case 1:
	  $link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_pbanners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_pbanners['products_name'] . '"></a>';
	  break;
	case 2: // Link to Products
	  $link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_pbanner_id=' . $individual_banner_id . '" border="0" alt="' . $affiliate_pbanners['products_name'] . '"></a>';
	  break;
  }
}
?>
	  <tr>
		<td class="smallText" align="center"><br><?php echo $link; ?></td>
	  </tr>
	  <tr>
		<td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td>
	  </tr>
	  <tr>
		<td align="center"><?php echo tep_draw_textarea_field('affiliate_banner', 'soft', '60', '6', $link); ?></td>
	  </tr>
<?php
 }
?>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
  </tr>
<?php
 if (tep_db_num_rows($affiliate_banners_values)) {

while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_values)) {
  $affiliate_products_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $affiliate_banners['affiliate_products_id'] . "' and language_id = '" . $languages_id . "'");
  $affiliate_products = tep_db_fetch_array($affiliate_products_query);
  $prod_id = $affiliate_banners['affiliate_products_id'];
  $ban_id = $affiliate_banners['affiliate_banners_id'];
  switch (AFFILIATE_KIND_OF_BANNERS) {
	case 1: // Link to Products
	  if ($prod_id > 0) {
		$link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
	  } else { // generic_link
		$link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
	  }
	  break;
	case 2: // Link to Products
	  if ($prod_id > 0) {
		$link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
	  } else { // generic_link
		$link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
	  }
	  break;
  }
?>
  <tr>
	<td><table width="100%" border="0" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME . ' ' . $affiliate_banners['affiliate_banners_title']; ?></td>
	  </tr>
	  <tr>
		<td class="smallText" align="center"><br><?php echo $link; ?></td>
	  </tr>
	  <tr>
		<td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td>
	  </tr>
	  <tr>
		<td class="smallText" align="center"><?php echo tep_draw_textarea_field('affiliate_banner', 'soft', '60', '6', $link); ?></td>
	  </tr>
	</table></td>
  </tr>	
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
  </tr>
<?php
}
 }
?>
</table>

 

anyone else using this with STS ?

or anyone see my issue ?

Link to comment
Share on other sites

They are two files in the catalog folder where the category path could be set.

 

affiliate_banners_category.php and affiliate_banners_build_cat.php

 

here is the code snippet from the affiliate_banners_build_cat.php

<?php
 if (tep_not_null($HTTP_POST_VARS['individual_banner_id']) || tep_not_null($HTTP_GET_VARS['individual_banner_id'])) {

if (tep_not_null($HTTP_POST_VARS['individual_banner_id'])) $individual_banner_id = $HTTP_POST_VARS['individual_banner_id'];
if ($HTTP_GET_VARS['individual_banner_id']) $individual_banner_id = $HTTP_GET_VARS['individual_banner_id'];
$affiliate_pbanners_values = tep_db_query("select c.categories_image,c.parent_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $individual_banner_id . "' and cd.categories_id = '" . $individual_banner_id . "' and cd.language_id = '" . $languages_id . "'");
if ($affiliate_cbanners = tep_db_fetch_array($affiliate_pbanners_values)) {
   $affiliate_pbanners_values2 = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $affiliate_cbanners["parent_id"] . "' and language_id = '" . $languages_id . "'");
$affiliate_cbanners2 = tep_db_fetch_array($affiliate_pbanners_values2);
  switch (AFFILIATE_KIND_OF_BANNERS) {
	case 1:
  			$link = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_cbanners['categories_image'] . '" border="0" alt="' .$affiliate_cbanners2['categories_name']. ' '. $affiliate_cbanners['categories_name'] . '"></a>';
  			$link1 = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_cbanners['categories_image'] . '" border="0" alt="'.$affiliate_cbanners2['categories_name']. ' '. $affiliate_cbanners['categories_name'] . '"></a>';
  			$link2 = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank">' .$affiliate_cbanners2['categories_name']. ' '. $affiliate_cbanners['categories_name'] . '</a>'; 
  		break; 
	  case 2: 
  // Link to Products 
  			$link = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_cbanner_id=' . $individual_banner_id . '" border="0" alt="' .$affiliate_cbanners2['categories_name']. ' '. $affiliate_cbanners['categories_name'] . '"></a>';
  			$link1 = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_cbanner_id=' . $individual_banner_id . '" border="0" alt="' .$affiliate_cbanners2['categories_name']. ' '. $affiliate_cbanners['categories_name'] . '"></a>';
  			$link2 = '<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&cPath=' . $individual_banner_id . '&affiliate_banner_id=1" target="_blank">' .$affiliate_cbanners2['categories_name']. ' '. $affiliate_cbanners['categories_name'] . '</a>'; 
  		break; 
 } 
} 
?>

 

and here from the affiliate_banners_category.php

 

<?php
 if (tep_db_num_rows($affiliate_banners_values)) {

while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_values)) {
  $affiliate_categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $affiliate_banners['affiliate_category_id'] . "' and language_id = '" . $languages_id . "'");
  $affiliate_categories = tep_db_fetch_array($affiliate_categories_query);
  $prod_id = $affiliate_banners['affiliate_category_id'];
  $ban_id = $affiliate_banners['affiliate_banners_id'];
  switch (AFFILIATE_KIND_OF_BANNERS) {
	case 1: // Link to Categories
	  if ($prod_id > 0) {
		$link = '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_categories['categories_name'] . '"></a>';
		$link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_categories['categories_name'] . '"></a>';
		$link2 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $affiliate_categories['categories_name'] . '</a>';
		}
	  break;
	case 2: // Link to Categories
	  if ($prod_id > 0) {
		$link = '<a href="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTPS_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_categories['categories_name'] . '"></a>';
		$link1 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_categories['categories_name'] . '"></a>';
		$link2 = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_CATEGORIES_INFO . '?ref=' . $affiliate_id . '&cPath=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank">' . $affiliate_categories['categories_name'] . '</a>';
		}
	  break;
  }

 

Please check

Link to comment
Share on other sites

I'm trying to install osCAffiliate v2.6_1, but I can't do it without help.

I'm uploading all the files for corresponding folders.

but I found 2 problems:

1.) In contribution file: Admin\Images\Categories\affiliate.gif

in my server I have Admin\Images but no Categories folder

I must upload Categories\affiliate.gif to Admin\Images?

 

2.) afffunct\affiliate_functions.php

afffunct\admin\affiliate_functions.php

I suppose this files musts be upload in the root, am I right?

 

Great if someone could help me, please.......

Link to comment
Share on other sites

I'm trying to install osCAffiliate v2.6_1, but I can't do it without help.

I'm uploading all the files for corresponding folders.

but I found 2 problems:

1.) In contribution file: Admin\Images\Categories\affiliate.gif

in my server I have Admin\Images but no Categories folder

I must upload Categories\affiliate.gif to Admin\Images?

 

2.) afffunct\affiliate_functions.php

afffunct\admin\affiliate_functions.php

I suppose this files musts be upload in the root, am I right?

 

Great if someone could help me, please.......

 

 

Can someone help me on this? Pleeeease........

Link to comment
Share on other sites

FYI... I figured out why my Affiliate Sales were not being recorded...

I forgot to add the required code modification to checkout_process.php. Once I added the statements, the Affiliate Sales are now recorded properly!

Once again... Great job on this add-on!!!

I am also VERY interested in the integrated PayPal feature for the Affiliates. That will make paying my International Affiliates much easier.

I look forward to the update!

-R

Can you direct me to the code that needs changed? Thanks

Link to comment
Share on other sites

  • 2 weeks later...

Hi folks!

 

Installed 2.6 version for my store.

 

Just one prob by now: I do not have access to "Affiliates" menu in my admin area.

 

Got message:"Access Denied

No Right Permission Access

Please contact your Web Administrator to request

more access or if you found any problem."

 

Any idea?

Link to comment
Share on other sites

Hi all,

 

Just wondering if you can help me perform a modification to the affiliate contribution.

 

Basically what I want to do is record the affiliate number to customer accounts when they create an account. I figure this could be added in create_account.php, I'd also need to modify checkout_process.php or affiliate_checkout_process.php (Includes) in order to call the recorded affiliate number from the customers account on the database.

 

I want to do this so that the affiliate who promotes the website to the customer gets a percentage of everything that customer buys in the future.

 

Anyone got any ideas how I go about doing this please?

 

I'll give it a go myself but it might take some time and if others have more of a clue of how to do this quickly it'd be a huge help.

 

Cheers

Edited by Peak Displays
Link to comment
Share on other sites

HI,

 

my point of view is, that you can solve it on different ways by

 

mapping the customer id to affiliate id if the customer buy something the first time

therefore

 

1. create an additional field in database table 'customer' where you put the affilliate number in

2. modify the includes/affiliate_checkout_process.php and put in an sql query where you write

the affiliate_id into the new defined customer_field

3. you have to write a new affiliate file where you get the orders via customer id and map them by using

the affiliate_id from table customer to the affiliate id to show the affiliate the overall made orders by this customer

 

the second way may be to get the sessions_vars which includes the affiliate_id (take a look in the includes/affiliate_checkout_process.php )

and use them when in creat account.php

 

hope this will help you

Link to comment
Share on other sites

HI,

 

my point of view is, that you can solve it on different ways by

 

mapping the customer id to affiliate id if the customer buy something the first time

therefore

 

1. create an additional field in database table 'customer' where you put the affilliate number in

2. modify the includes/affiliate_checkout_process.php and put in an sql query where you write

the affiliate_id into the new defined customer_field

3. you have to write a new affiliate file where you get the orders via customer id and map them by using

the affiliate_id from table customer to the affiliate id to show the affiliate the overall made orders by this customer

 

the second way may be to get the sessions_vars which includes the affiliate_id (take a look in the includes/affiliate_checkout_process.php )

and use them when in creat account.php

 

hope this will help you

Yeah I kinda agree,

 

So I made a field in the Customer table called customer_affiliate.

 

I now need to change the call function to pull the ref from customer_affiliate rather than looking for affiliate_ref in the cookie or sessions. I'm not too good with things like this.

 

I've put in an affiliate code on my test account in the customer_affiliate. So once I get includes/affiliate_checkout_process.php to pull that affiliate code I will then go back to create_account.php and worry about making that script update customer_affiliate with the affiliate_ref.

 

I presume I need to change the following in includes/affiliate_checkout_process.php:

 

if ($HTTP_SESSION_VARS['affiliate_ref'])

 

to be an 'if' statement that pulls the ref from customer_affiliate, any one have any ideas what I ought to change it too?

 

Thanks

 

Paul

Link to comment
Share on other sites

I thought maybe something like this.

 

Change:

 

if ($HTTP_SESSION_VARS['affiliate_ref']) {

 

To:

 

$sql_data_array = array('customers_affiliate' => $customers_affiliate);

if ($customers_affiliate > 0) {

$customers_affiliate = $affiliate_ref;

 

But that doesn't work.

 

Anyone know what I'm doing wrong?

 

Cheers

 

Paul

 

N.B the field was customers_affiliate not customer_affiliate as I put in the other post.

Edited by Peak Displays
Link to comment
Share on other sites

Take a look into the affiliate_application_top.php in the includes folder

 

there you will be able to find all necessary code snippets for your project.

 

 

 

 if (($HTTP_GET_VARS['ref'] || $HTTP_POST_VARS['ref'])) {
  if ($HTTP_GET_VARS['ref']) $affiliate_ref = preg_replace("/[^0-9]/","", $HTTP_GET_VARS['ref']);
  if ($HTTP_POST_VARS['ref']) $affiliate_ref = preg_replace("/[^0-9]/","", $HTTP_POST_VARS['ref']);

	   HERE you have to check if the customer is registered and if the field aff_ref in customer table is not null
	   and if so, then update the customer table with the $affiliate_ref 

}

Edited by shetani
Link to comment
Share on other sites

Take a look into the affiliate_application_top.php in the includes folder

 

there you will be able to find all necessary code snippets for your project.

 if (($HTTP_GET_VARS['ref'] || $HTTP_POST_VARS['ref'])) {
  if ($HTTP_GET_VARS['ref']) $affiliate_ref = preg_replace("/[^0-9]/","", $HTTP_GET_VARS['ref']);
  if ($HTTP_POST_VARS['ref']) $affiliate_ref = preg_replace("/[^0-9]/","", $HTTP_POST_VARS['ref']);

	   HERE you have to check if the customer is registered and if the field aff_ref in customer table is not null
	   and if so, then update the customer table with the $affiliate_ref 

}

 

Hmm what version are you using, the same bit of code in my affiliate_application_top.php doesn't look like that, it looks like this:

 

	if (($HTTP_GET_VARS['ref'] || $HTTP_POST_VARS['ref'])) {
  if ($HTTP_GET_VARS['ref']) $affiliate_ref = $HTTP_GET_VARS['ref'];
  if ($HTTP_POST_VARS['ref']) $affiliate_ref = $HTTP_POST_VARS['ref'];
  if ($HTTP_GET_VARS['products_id']) $affiliate_products_id = $HTTP_GET_VARS['products_id'];
  if ($HTTP_POST_VARS['products_id']) $affiliate_products_id = $HTTP_POST_VARS['products_id'];
  if ($HTTP_GET_VARS['affiliate_banner_id']) $affiliate_banner_id = $HTTP_GET_VARS['affiliate_banner_id'];
  if ($HTTP_POST_VARS['affiliate_banner_id']) $affiliate_banner_id = $HTTP_POST_VARS['affiliate_banner_id'];

 

I'm having problems calling the customer_id into the scripts too, in order to make it work. Frankly I haven't got a clue and there is no indication on how to do it in the script as you suggest I'm afraid.

 

Cheers

 

Paul

Link to comment
Share on other sites

the preg_replace lines are not original but should be there to reduce risk of sql injection in osc-affiliate.

 

will have a look on that next few days

 

Hi Frank,

 

Don't worry about it. I figure out how to do it, although it's a bit messy it works a treat. I changed the following in includes/affliate_checout_process.php:

 

//  if ($HTTP_SESSION_VARS['affiliate_ref']) {

 

To:

 

//BOF Customer Affiliate
 $customers_aff_raw = "select customers_affiliate as count from " . TABLE_CUSTOMERS .  " where customers_id  = '" . $customer_id . "'";
 $customers_aff_query=tep_db_query($customers_aff_raw);
 $customers_aff_count = tep_db_fetch_array($customers_aff_query);
 $affiliate_ref = $customers_aff_count['count'];

 if ($affiliate_ref > 0) {
// EOF Customer Affiliate

 

I know the whole count thing is unecessary but it kept printing up array and my php is so bad I couldn't figure it out. Anyway using the above pulls the customers_affiliate from the customers table and when the checkout process proceeds it records the affiliate for that number on the database. I then modified create_account.php so that it will pull the affiliate code from sessions and write it to the customers_affiliate on the customers table and it now works exactly how I want it too. I need to check that it's still fine on cookies etc but I don't see why it won't be.

 

Cheers

 

Paul

Link to comment
Share on other sites

  • 2 weeks later...

Using Osc Affiliate 2.7 affiliate_signup.php the following error occur whenever the dob input is in the incorrect format:

Warning: checkdate() expects parameter 1 to be long, string given in /home/medsindy/public_html/affiliate_signup.php on line 75

 

The osc warning appears as it should as well. But the affiliate freak out and call for help when they see the other warning at the top and don't notice the warning that says they entered it wrong.

I have moved on from oscommerce to magento and no longer monitoring this site.

Link to comment
Share on other sites

Using Osc Affiliate 2.7 affiliate_signup.php the following error occur whenever the dob input is in the incorrect format:

Warning: checkdate() expects parameter 1 to be long, string given in /home/medsindy/public_html/affiliate_signup.php on line 75

 

The osc warning appears as it should as well. But the affiliate freak out and call for help when they see the other warning at the top and don't notice the warning that says they entered it wrong.

 

I found the solution here: http://www.oscommerce.com/forums/index.php?s=&...st&p=751745

 

I changed line 75 as follows and it works fine now:

 

if (@checkdate(substr(tep_date_raw($a_dob), 4, 2), substr(tep_date_raw($a_dob), 6, 2), substr(tep_date_raw($a_dob), 0, 4))) {

I have moved on from oscommerce to magento and no longer monitoring this site.

Link to comment
Share on other sites

Hi All,

 

During install and QA of version 2.7, i have encountered a problem with the Welcome email that the system is sending to the affiliate: all the individual information- ID, NAME, USER NAME etc. is lacking and the instead it shows:

---------------------------------------------------------------------------------------------------------------------------------------------------

Dear

 

Thank you for joining xxxxx.com Affiliate Program

 

Your Account Information:

**********************************************

 

Your Affiliate ID is:Your Affiliate Username is:Your Password is:Link to your account:

 

Have fun earning referral fees!

 

 

---------------------------------------------------------------------------------------------------------------------------------------------------

 

I have tried several things, but nothing... :(

can any one help please?

 

Many thanks

Sharon.

Installed contributions:

Ultimate_SEO, Article Manager 1.5, Dynamic SiteMap 2.0, Infopages, Google SiteMap XMl w/admin 2.1, HeaderTagControler 2.6.1, FCKosc 2.21, X-sell 2.3, Google Analytics Modul, All Products, Page Cache 1.5, EasyPopulate2.7d, Multi Product Manager 2.5, Define Main Page, and probably few others...

Link to comment
Share on other sites

Hi All,

 

During install and QA of version 2.7, i have encountered a problem with the Welcome email that the system is sending to the affiliate: all the individual information- ID, NAME, USER NAME etc. is lacking and the instead it shows:

---------------------------------------------------------------------------------------------------------------------------------------------------

 

The 2.7 version of the affiliate module has A LOT of typos in it. I have fixed all of them (I think).

 

I have uploaded my fix to the confirmation email here:

http://walki-talki.com/affiliate_html_mail.zip

 

For this fix to work, you MUST turn html emailing on in your control panel.

 

This is for the English version. I trust you know which file goes into the store folder and which one into includes/languages/english

 

I hope to upload all my fixes to the system as soon as I have the chance, which may be a while from now.

 

Best,

Payam

walki-talki.com

Payam

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...