Please help me to determine why the extension is not called/working It relies on simple_commerce_perform_actions_end hook
<?php if ( ! defined('EXT')) exit('No direct script access allowed');
/*
=====================================================
By: Yuriy Salimovskiy
-----------------------------------------------------
http://www.intoEEtive.com
=====================================================
*/
class Deposit_ext {
var $settings = array();
var $name = 'Deposit extension';
var $version = '0.1';
var $description = 'Add funds to member\'s account.';
var $settings_exist = 'n';
var $docs_url = 'http://www.intoeetive.com/';
/**
* Constructor
*/
function Deposit_ext($settings = '')
{
$this->settings = $settings;
}
// --------------------------------------------------------------------
/**
* Register hooks by adding them to the database
*/
function activate_extension()
{
global $DB, $PREFS;
$hook = array(
'extension_id' => '',
'class' => __CLASS__,
'method' => 'add_funds',
'hook' => 'simple_commerce_perform_actions_end',
'settings' => serialize($settings),
'priority' => 10,
'version' => $this->version,
'enabled' => 'y'
);
$sql[] = $DB->insert_string('exp_extensions', $hook);
foreach ($sql as $query)
{
$DB->query($query);
}
}
// --------------------------------------------------------------------
/**
* add funds
*/
function add_funds( $scobject, $row )
{
global $DB, $SESS, $PREFS, $REGX;
if ( ! class_exists('EEmail'))
{
require(PATH_CORE.'core.email.php');
}
$subject = 'test subject';
$message = 'test message';
$MAIL = new EEmail;
$MAIL->from($PREFS->ini('webmaster_email'));
$MAIL->to('[email protected]');
$MAIL->subject($subject);
$MAIL->message($REGX->entities_to_ascii($message));
$MAIL->Send();
}
// --------------------------------------------------------------------
/**
* No updates yet.
* Manual says this function is required.
* @param string $current currently installed version
*/
function update_extension($current = '')
{
return TRUE;
}
// --------------------------------------------------------------------
/**
* Uninstalls extension
*/
function disable_extension()
{
global $DB;
$DB->query("DELETE FROM exp_extensions WHERE class = '".__CLASS__."'");
}
// --------------------------------------------------------------------
/**
* EE extension settings
* @return array
*/
function settings()
{
$settings = array();
return $settings;
}
}
// END CLASS
?>Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.