New Zenner
- Join Date:
- Sep 2012
- Posts:
- 27
- Plugin Contributions:
- 0
Bank Transfer Discount Display SQL
Hi,
I inserted this into the ot_total.php, but it does not send the discount price to the database or the e-mail.
What file should I edit, if I want that the new price shows in the database and email.
<?php /** * ot_total order-total module * * @package orderTotal * @copyright Copyright 2003-2007 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_total.php 6725 2007-08-19 03:48:28Z drbyte $ */ class ot_total2 { var $title, $output; function ot_total2() { $this->code = 'ot_total2'; $this->title = MODULE_ORDER_TOTAL_TOTAL_TITLE2; $this->description = MODULE_ORDER_TOTAL_TOTAL_DESCRIPTION2; $this->sort_order = MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER2; $this->output = array(); } function process() { global $order, $currencies, $discount_total, $discount_initial; $discount_initial = $order->info['total']*0.02; $discount_total = $order->info['total'] - $discount_initial; $this->output[] = array('title' => $this->title . ':', 'text' => $currencies->format($discount_total, true, $order->info['currency'], $order->info['currency_value']), 'value' => $discount_total); } function check() { global $db; if (!isset($this->_check)) { $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TOTAL_STATUS2'"); $this->_check = $check_query->RecordCount(); } return $this->_check; } function keys() { return array('MODULE_ORDER_TOTAL_TOTAL_STATUS2', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER2'); } function install() { global $db; $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('This module is installed', 'MODULE_ORDER_TOTAL_TOTAL_STATUS2', 'true', '', '6', '1','zen_cfg_select_option(array(\'true\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TOTAL_SORT_ORDER2', '1000', 'Sort order of display.', '6', '2', now())"); } function remove() { global $db, $messageStack; if (!isset($_GET['override']) && $_GET['override'] != '1') { $messageStack->add('header', ERROR_MODULE_REMOVAL_PROHIBITED . $this->code); return false; } $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } } ?>Thanks for the help in advance!