Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC-Affiliate Help or Suggest Affiliate Plugin


Recommended Posts

I am looking for help on how to install OSC-Affiliate to the current version of OSC. there does not seem to be an update on this mod so if there is a more current affiliate mod I would be very interested.

 

This is where I got stuck.....This array has been moved or is no longer used ( full install notes below )

 

ADMIN ALTERATIONS

In index.php in the admin directory find line 50 approx

array('title' => REPORTS_ORDERS, 'link' => tep_href_link(FILENAME_STATS_CUSTOMERS, 'selected_box=reports')))),

and on a new line add the following code after it:

		   array('title' => BOX_HEADING_AFFILIATE,
				 'image' => 'affiliate.gif',
				 'href' => tep_href_link(FILENAME_AFFILIATE_SUMMARY, 'selected_box=affiliate'),
				 'children' => array(array('title' => BOX_AFFILIATE, 'link' => tep_href_link(FILENAME_AFFILIATE, 'selected_box=affiliate')),
									 array('title' => BOX_AFFILIATE_BANNERS, 'link' => tep_href_link(FILENAME_AFFILIATE_BANNERS, 'selected_box=affiliate')))),

 

Full Install Notes Included With Mod Download

 

/*
 $Id: INSTALL_ENG.txt,v 2.01 2005/05/25

 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
*/

NOTE: This is a loaded release version of the osCAffiliate module for osCommerce.

This release is based on the development version of osCAffiliate which can be found at
http://sourceforge.net/projects/oscaffiliate

PLEASE NOTE. THIS IS A LOADED VERSION BASED ON THE CVS DEVELOPMENT VERSION.

The module has been designed to be intergrated into osCommerce. 
While the module is based on the release version of osCommerce 2.2 Milestone 2.

It may be possible to intergrate this module with CVS versions of osCommerce 2.2 but no support is given, 
due to the constantly changing code base of the CVS

Unlike some other mods this module has been designed in such a way as to have 
minimal impact on the osC core files, which allows for easy upgrades as newer 
versions of the module are released.


For details on the official development version of this module go to:
http://sourceforge.net/projects/oscaffiliate


********  TO INSTALL **********

NEW INSTALLATIONS ONLY (FOR UPGRADES SEE THE INCLUDED FILE NAMED UPGRADE_ENG.txt)


Upload all files to corresponding folders of your osCommerce site.

You must also perform a few manual alterations to your osCommerce files:

THERE ARE affiliate_configure.php files in the catalog/includes and admin/includes folders -> look at them !!!

Read the FAQ


********  IT IS STRONGLY SUGGESTED TO MAKE A BACK-UP OF THESE FILES FIRST **********


MySQL ALTERATIONS

Insert the new tables found in the affiliate.sql file into your osCommerce catalog database.


CATALOG ALTERATIONS


In application_top.php in the catalog/includes directory enter at the end of the file before ?>:

// Include OSC-AFFILIATE
 require(DIR_WS_INCLUDES . 'affiliate_application_top.php');


In checkout_process.php in the catalog directory find line 

 // load the after_process function from the payment modules
 $payment_modules->after_process();

and insert before it

 // Include OSC-AFFILIATE 
 require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php');



In catalog/includes/column_left.php (or whereever you want the box) find

  if ( (USE_CACHE == 'true') && !SID) {
echo tep_cache_categories_box();
 } else {
include(DIR_WS_BOXES . 'categories.php');
 }

 if ( (USE_CACHE == 'true') && !SID) {
echo tep_cache_manufacturers_box();
 } else {
include(DIR_WS_BOXES . 'manufacturers.php');
 }

and on a new line add this after it:

 require(DIR_WS_BOXES . 'affiliate.php');

################################################################################
##################################


ADMIN ALTERATIONS

In index.php in the admin directory find line 13 approx

 require('includes/application_top.php');

and on a new line add the following code after it:

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();


In index.php in the admin directory find line 50 approx

array('title' => REPORTS_ORDERS, 'link' => tep_href_link(FILENAME_STATS_CUSTOMERS, 'selected_box=reports')))),

and on a new line add the following code after it:

		   array('title' => BOX_HEADING_AFFILIATE,
				 'image' => 'affiliate.gif',
				 'href' => tep_href_link(FILENAME_AFFILIATE_SUMMARY, 'selected_box=affiliate'),
				 'children' => array(array('title' => BOX_AFFILIATE, 'link' => tep_href_link(FILENAME_AFFILIATE, 'selected_box=affiliate')),
									 array('title' => BOX_AFFILIATE_BANNERS, 'link' => tep_href_link(FILENAME_AFFILIATE_BANNERS, 'selected_box=affiliate')))),


In index.php in the admin directory find line 106 approx

			<td width="140" valign="top"><table border="0" width="140" height="390" cellspacing="0" cellpadding="2">


and replace that line with the following code :

			<td width="160" valign="top"><table border="0" width="160" height="390" cellspacing="0" cellpadding="2">



In index.php in the admin directory find lines 167 to 173 approx

 $contents[] = array('params' => 'class="infoBox"',
				  'text'  => BOX_ENTRY_CUSTOMERS . ' ' . $customers['count'] . '<br>' .
							 BOX_ENTRY_PRODUCTS . ' ' . $products['count'] . '<br>' .
							 BOX_ENTRY_REVIEWS . ' ' . $reviews['count']);

 $box = new box;
 echo $box->menuBox($heading, $contents);

 echo '<br>';

and on a new line add the following code after it:


$affiliate_sales_raw = "select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " ";
$affiliate_sales_query= tep_db_query($affiliate_sales_raw);
$affiliate_sales= tep_db_fetch_array($affiliate_sales_query);

$affiliate_clickthroughs_raw = "select count(*) as count from " . TABLE_AFFILIATE_CLICKTHROUGHS . " ";
$affiliate_clickthroughs_query=tep_db_query($affiliate_clickthroughs_raw);
$affiliate_clickthroughs= tep_db_fetch_array($affiliate_clickthroughs_query);
$affiliate_clickthroughs=$affiliate_clickthroughs['count'];

$affiliate_transactions=$affiliate_sales['count'];
if ($affiliate_transactions>0) {
$affiliate_conversions = tep_round($affiliate_transactions/$affiliate_clickthroughs,6)."%";
}
else $affiliate_conversions="n/a";

$affiliate_amount=$affiliate_sales['total'];
if ($affiliate_transactions>0) {
$affiliate_average=tep_round($affiliate_amount/$affiliate_transactions,2);
}
else {
$affiliate_average="n/a";
}
$affiliate_commission=$affiliate_sales['payment'];

$affiliates_raw = "select count(*) as count from " . TABLE_AFFILIATE . "";
$affiliates_raw_query=tep_db_query($affiliates_raw);
$affiliates_raw = tep_db_fetch_array($affiliates_raw_query);
$affiliate_number= $affiliates_raw['count'];


 $heading = array();
 $contents = array();

 $heading[] = array('params' => 'class="menuBoxHeading"',
				 'text'  => BOX_TITLE_AFFILIATES);

 $contents[] = array('params' => 'class="infoBox"',
				  'text'  => BOX_ENTRY_AFFILIATES . ' ' . $affiliate_number . '<br>' .
							 BOX_ENTRY_CONVERSION . ' ' . $affiliate_conversions . '<br>' .
							 BOX_ENTRY_COMMISSION . ' ' . $currencies->display_price($affiliate_commission, ''));

 $box = new box;
 echo $box->menuBox($heading, $contents);

 echo '<br>';

In application_top.php in the admin/includes enter at the end of the file before ?>:


// Include OSC-AFFILIATE
 require(DIR_WS_INCLUDES . 'affiliate_application_top.php');


In column_left.php in the admin/includes directory find line 19 approx

 require(DIR_WS_BOXES . 'reports.php');

and on a new line add this after it:

 require(DIR_WS_BOXES . 'affiliate.php');




Install:

catalog/product_info.php 


After:

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>


Add:

<br><br>
 <?php
//affiliate build a link begin
	if (tep_session_is_registered('affiliate_id')) {
		?>
	 <?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, 'individual_banner_id=' . $product_info['products_id']) .'" target="_self">' . tep_image('includes/languages/english/images/buttons/button_affiliate_build_a_link.gif', 'Make a link') . ' </a>'; ?><?php
	}
//affiliate build a link begin
	 ?>

FILENAMES.PHP in CATALOG
ADD
define('FILENAME_CATEGORIES_INFO', 'index.php');


Back up your files first!

To combine the two, open /includes/modules/payment/paypal_ipn.php

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

Find this code around line 83:
function confirmation() {
  global $cartID, $cart_PayPal_IPN_ID, $customer_id, $languages_id, $insert_id, $order, $order_total_modules;

directly below add this code: 
  global $affiliate_ref, $affiliate_clientdate, $affiliate_clientbrowser, $affiliate_clientip, $affiliate_clickthroughs_id, $HTTP_SESSION_VARS;

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

Find this code around line 250:
	  $cart_PayPal_IPN_ID = $cartID . '-' . $insert_id;
	  tep_session_register('cart_PayPal_IPN_ID');
	}
  }
  return false;
}

and change to:
  $cart_PayPal_IPN_ID = $cartID . '-' . $insert_id;
	  tep_session_register('cart_PayPal_IPN_ID');
	}
  }

 // Include OSC-AFFILIATE
 require(DIR_WS_INCLUDES . 'affiliate_checkout_process.php');	  

  return false;
}

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


********  TO USE THIS MODULE **********

All you will need to do is go into your stores admin and select the store configuration section. 
You will find a tab under this section called Affiliate Configuration. Select this tab and and 
set up your basic info such as affiliate rate percent, contact email etc.

Then move into the Affiliate Section of your store's admin and setup Banners, Links etc.

Taxes:
It's possible to use taxes on the affiliate provision. At the moment you can adjust the settings in the
affiliate_configure.php file located in the admin/includes/ folder.

Please tell us, if you handle the taxes for provisions in an other way at your country.


********  IT IS STRONGLY SUGGESTED TO MAKE A BACK-UP OF THESE FILES FIRST **********



********  BUGS **********

If you find any bugs please report them at http://sourceforge.net/projects/oscaffiliate or at the osCommerce Support Site


********  DEVELOPERS **********

Henri Schmidhuber IN-Solution   	http://www.in-solution.de	(Developer, Project Manager)
Donate via paypal:		  https://www.paypal.com/xclick/business=henri%40in-solution.de
Amazon.de Wishlist: 		http://www.amazon.de/exec/obidos/wishlist/EQKIUJPZ63E2

Steve Kemp   Snowtech Services	  http://www.snowtech.com.au	(Developer)
Donate via paypal:		  https://www.paypal.com/xclick/business=info%40alpinehosting.net


********  CREDITS **********

Credit to everyone that has inspired us in the development of this evolving module for osCommerce.

 

Thank you

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