Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

order editor v5 -- problem with fixed payment charge


ri.noceros

Recommended Posts

hallo,

 

I´ve a small problem with the contrib "order editor v5" and "fixed payment charge"

when i change values @ the order editor interface in admin I get the message -

 

Fatal error: Call to a member function on a non-object in /srv/www/htdocs/web551/html/includes/modules/order_total/ot_fixed_payment_chg.php on line 105

 

line 105 is:

 

$products = $cart->get_products();

 

or in the context:

 

87 $order->info['tax_groups'][$tod_description] += tep_calculate_tax($table[$i+1] + $table[$i+2],
$tod_rate);
88 }
89
90 if (DISPLAY_PRICE_WITH_TAX) {
91 $od_amount = $od_am_fixed + $od_am_percentage + $tod_amount;
92 } else {
93 $od_amount = $od_am_fixed + $od_am_percentage;
94 $order->info['total'] += $tod_amount;
95 }
96 }
97 }
98 return $od_amount;
99 }
100
101 function get_order_total() {
102 global $order, $cart;
103 $order_total = $order->info['total'];
104 // Check if gift voucher is in cart and adjust total
105 $products = $cart->get_products();
106 for ($i=0; $i<sizeof($products); $i++) {
107 $t_prid = tep_get_prid($products[$i]['id']);
108 $gv_query = tep_db_query("select products_price, products_tax_class_id, products_model from " . TAB
LE_PRODUCTS . " where products_id = '" . $t_prid . "'");
109 $gv_result = tep_db_fetch_array($gv_query);
110 if (ereg('^GIFT', addslashes($gv_result['products_model']))) {
111 $qty = $cart->get_quantity($t_prid);
112 $products_tax = tep_get_tax_rate($gv_result['products_tax_class_id']);
113 if ($this->include_tax =='false') {
114 $gv_amount = $gv_result['products_price'] * $qty;
115 } else {
116 $gv_amount = ($gv_result['products_price'] + tep_calculate_tax($gv_result['products_price'],$pr
oducts_tax)) * $qty;
117 }
118 $order_total=$order_total - $gv_amount;
119 }
120 }
121 if ($this->include_tax == 'false') $order_total=$order_total-$order->info['tax'];
122 if ($this->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost'];
123 return $order_total;
124 }
125
126 function check() {
127 if (!isset($this->check)) {
128 $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where conf
iguration_key = 'MODULE_FIXED_PAYMENT_CHG_STATUS'");
129 $this->check = tep_db_num_rows($check_query);
130 }
131
132 return $this->check;
133 }
134
135 function keys() {
136 return array('MODULE_FIXED_PAYMENT_CHG_STATUS', 'MODULE_FIXED_PAYMENT_CHG_SORT_ORDER', 'MODULE_FIXED_
PAYMENT_CHG_TYPE', 'MODULE_FIXED_PAYMENT_CHG_TYPE_DESCRIPTION', 'MODULE_FIXED_PAYMENT_CHG_TAX_CLASS');
137 }
138
139 function install() {
140 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, config
uration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) val
ues ('Display Total', 'MODULE_FIXED_PAYMENT_CHG_STATUS', 'true', 'Do you want to display the payment charge
', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
141 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, config
uration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Ord
er', 'MODULE_FIXED_PAYMENT_CHG_SORT_ORDER', '10', 'Sort order of display.', '6', '2', now())");
142 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, config
uration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Discount
Percentage', 'MODULE_FIXED_PAYMENT_CHG_AMOUNT', '2', 'Amount of Discount.', '6', '7', now())");
143 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, config
uration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Payment
Type', 'MODULE_FIXED_PAYMENT_CHG_TYPE', 'moneyorder:5:%0,cod:50:%10', 'Payment Types to get charge', '6', '
2', now())");
144 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, config
uration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Payment
Type Description', 'MODULE_FIXED_PAYMENT_CHG_TYPE_DESCRIPTION', 'moneyorder:Fee for Money Order,cod:Fee for
Cash on Delivery', 'Description for each payment type.', '6', '3', now())");
145 tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, config
uration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, d
ate_added) values ('Tax Class', 'MODULE_FIXED_PAYMENT_CHG_TAX_CLASS', '0', 'Use the following tax class on
the payment charge.', '6', '6', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
146 }
147
148 function remove() {
149 $keys = '';
150 $keys_array = $this->keys();
151 for ($i=0; $i<sizeof($keys_array); $i++) {
152 $keys .= "'" . $keys_array[$i] . "',";
153 }
D:\OS_commerce\includes\modules\order_total\ot_fixed_payment_chg.php: 2/3

 

 

Does anybody know what I´ve to change?

 

I couldn´t find the answer on my research....

 

Thx much!

Rhino

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...