here is what is in the beginning of the file
Code:
<?php
/**
* @package orderTotal
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: ot_gv.php 4975 2006-11-20 22:11:21Z wilt $
*/
class ot_clrp {
var $title, $output;
function ot_clrp() {
global $currencies;
$this->code = 'ot_clrp';
$this->title = MODULE_ORDER_TOTAL_CLRP_TITLE;
$this->header = MODULE_ORDER_TOTAL_CLRP_HEADER;
$this->description = MODULE_ORDER_TOTAL_CLRP_DESCRIPTION;
$this->user_prompt = MODULE_ORDER_TOTAL_CLRP_USER_PROMPT;
$this->sort_order = MODULE_ORDER_TOTAL_CLRP_SORT_ORDER;
$this->include_shipping = MODULE_ORDER_TOTAL_CLRP_INC_SHIPPING;
$this->include_tax = MODULE_ORDER_TOTAL_CLRP_INC_TAX;
$this->calculate_tax = MODULE_ORDER_TOTAL_CLRP_CALC_TAX;
$this->credit_tax = MODULE_ORDER_TOTAL_CLRP_CREDIT_TAX;
$this->tax_class = MODULE_ORDER_TOTAL_CLRP_TAX_CLASS;
$this->show_redeem_box = MODULE_ORDER_TOTAL_CLRP_REDEEM_BOX;
$this->credit_class = true;
if (!zen_not_null(ltrim($_SESSION['cot_clrp'], ' 0')) || $_SESSION['cot_clrp'] == '0') $_SESSION['cot_clrp'] = '0.00';
$this->checkbox = $this->user_prompt . '<input type="text" size="6" onchange="submitFunction()" name="cot_clrp" value="' . number_format($_SESSION['cot_clrp'], 2) . '" onfocus="if (this.value == \'' . number_format($_SESSION['cot_clrp'], 2) . '\') this.value = \'\';" />' . ($this->user_has_clrp_account($_SESSION['customer_id']) > 0 ? '<br />' . MODULE_ORDER_TOTAL_CLRP_USER_BALANCE . $currencies->format($this->user_has_clrp_account($_SESSION['customer_id'])) : '');
$this->output = array();
}
function process() {
global $order, $currencies;
if ($_SESSION['cot_clrp']) {
$order_total = $this->get_order_total();
$od_amount = $this->calculate_credit($order_total);
if ($this->calculate_tax != "none") {
$tod_amount = zen_round($this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax, true), 2);
$od_amount = $this->calculate_credit($order_total);
}
$this->deduction = $od_amount + $tod_amount;
$order->info['total'] = zen_round($order->info['total'] - $this->deduction, 2);
if ($od_amount > 0) {
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->deduction += zen_calculate_tax($this->deduction, $tax);
}
$this->output[] = array('title' => $this->title . ':',
'text' => '-' . $currencies->format($this->deduction),
'value' => $this->deduction);
}
}
}
Bookmarks