Okay, I've looked at the addon and taken an hour to look at the code and write and test the following alterations:
1. First, a CAUTION!!!!!!!
The addon is written for OLD versions of Zen Cart. Using it without upgrading all the files it touches will result in broken or lost functionality in your store.
2. If you want to switch it to use the more appropriate method of hooking notifier points rather than editing core code in order to inject items into the customer's cart, you can make the following changes:
a) delete the "create_account.php" file included in the addon. Not only is it for an old version of Zen Cart, but the next two files make it unnecessary to alter/touch the create_account.php file to accomplish the same thing:
b) create a new file: /includes/auto_loaders/config.membershipFee.php
containing just the following:
Code:
<?php
/**
* autoloader for MembershipFee addon
*
* @copyright Copyright 2003-2010 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: config.membershipFee.php 2010-03-31 drbyte $
*/
$autoLoadConfig[90][] = array('autoType'=>'class',
'loadFile'=>'observers/class.membershipFee.php');
$autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
'className'=>'membershipFee',
'objectName'=>'membershipFee');
c) create a new file: /includes/classes/observers/class.membershipFee.php
containing just the following:
Code:
<?php
/**
* observer class for MembershipFee addon. Adds product ID specified in the MY_MEMBERSHIP_FEE constant (defined elsewhere) to the cart automatically upon create_account
*
* @copyright Copyright 2003-2010 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: class.membershipFee.php 2010-03-31 drbyte $
*/
class membershipFee extends base {
function membershipFee() {
global $zco_notifier;
$zco_notifier->attach($this, array('NOTIFY_LOGIN_SUCCESS_VIA_CREATE_ACCOUNT'));
}
function update(&$class, $eventID) {
if (!defined('MY_MEMBERSHIP_FEE') || (int)MY_MEMBERSHIP_FEE < 1) return FALSE;
$_SESSION['cart']->add_cart((int)MY_MEMBERSHIP_FEE);
}
}
The above components are all that is needed to get the product added to the cart upon create_account. (except for the define() for MY_MEMBERSHIP_FEE in the /extra_configures/membership_fee.php file)
3. All the other files included in the addon are used to prevent the ability to click on the "hidden" product anywhere in the store. However, as I mentioned, they are based on older versions of Zen Cart, and extreme caution should be used if you are going to use them on a newer version than what they were written for. WinMerge may be of help if you wish to upgrade them for some degree of compatibility.
Of course, donations are welcome at www.zen-cart.com/donate