Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Built-in Shipping and Payment Modules / order total modules error

order total modules error

Locked

Started by gabbytwin on 7 Aug 2008, 11:47 AM · Views: 2,706

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
7 Aug 2008, 11:47 AM
#1
gabbytwin avatar

gabbytwin

Zen Follower

Join Date:
Jun 2005
Posts:
94
Plugin Contributions:
0

order total modules error

Hi guys,
Hope someone has an idea on what I have done wrong here
when I go into order total to change some settings I am getting this error

Fatal error: Call to a member function format() on a non-object in /home/cheekybu/public_html/shop/includes/modules/order_total/ot_clrp.php on line 29

I am not sure what is wrong?

Thanks

7 Aug 2008, 11:48 AM
#2
gabbytwin avatar

gabbytwin

Zen Follower

Join Date:
Jun 2005
Posts:
94
Plugin Contributions:
0

Re: order total modules error

here is what is in the beginning of the file

<?php
/**
 * @package orderTotal
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license [url]http://www.zen-cart.com/license/2_0.txt[/url] 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);
      }
    }
  }