Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Total not working


jokerfr33

Recommended Posts

Posted

Hi all,

i have some trouble on OSC 2.2 RC, order total module is not working :

After a customer finish his payment, i have in DB all datas from his invoice (order, order product etc ..) but order total table is not populated,

i have order total module activated in admin, the files are on the server (/classes/order_total.php + the order_total folder under modules/ with all files in it

 

i added a log file in checkout_process.php, trying to figure what is going on, it look like :

for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { 

-> sizeof($order_totals) is empty

i'm using a payment module : Servired, in the configuration of this module, i had to add the following line in checkout_process.php

 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_totals = $order_total_modules->process();


if ( ($order->info['payment_method']!="Credit card (Servired)") && ($order->info['payment_method']!="Tarjeta de crédito (Servired)") ){

// load the before_process function from the payment modules

$payment_modules->before_process();

}

 

can anybody help me ?

Posted

why did you have to change the code for the before_process call?

 

where did you add the logging when testing, right after the first call of the variable?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted

Hi Monika, and thank's for taking time,

 

1 - this is part of configuration of the Servired payment module (Spanish payment processor, wich i downloaded from OScommerce's contribs).

require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_totals = $order_total_modules->process();


if ( ($order->info['payment_method']!="Credit card (Servired)") && ($order->info['payment_method']!="Tarjeta de crédito (Servired)") ){

// load the before_process function from the payment modules

$payment_modules->before_process();

}

2 - I added the logs in checkout_process.php :

i'm logging, all $_REQUEST, $_SESSION vars +

 

just after :

 $order_totals = $order_total_modules->process();

i log this :

$data .= "customers_id : ".$customer_id." \n";
$data .= "customers_name : ".$order->customer['firstname']." ".$order->customer['lastname']." \n";
$data .= "payment_method : ".$order->info['payment_method']." \n";
$data .= "payment_transaction_id : ".$order->info['payment_transaction_id']." \n";
$data .= "orders_status : ".$order->info['order_status']." \n";
$data .= "customers_address_format_id : ".$order->customer['format_id']." \n";
$data .= "sizeof order_totals : ".sizeof($order_totals)." \n";

 

and then, after :

  tep_db_perform(TABLE_ORDERS, $sql_data_array);
 $insert_id = tep_db_insert_id();

i logg this :

$data .= "insert_id : ".$insert_id." \n";
$data .= "sizeof order_totals : ".sizeof($order_totals)." \n";

thank's again for helping :)

 

Eric

Posted

please post an example output with asterixed values for sensitive info

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted

Justdid a real payment, here is the logs :

--------------------------------- 
21-09-2010 14:10:59 
--------------------------------- 
// this comes from REQUEST
osCsid=>1072ceec57ff90c2c3f17f4597404f3d
--------------------------------- 

// this comes just after $order_totals = $order_total_modules->process();
customers_id : 389 
customers_name : testeric4 testeric4 
payment_method : Credit card (Servired) 
orders_status : 1 
customers_address_format_id : 5 
sizeof order_totals : 0 

// this comes from 
// if(@is_array($order->info))
// {
// foreach($order->info as $key=>$val)
// {
// $data .= $key."=>".$val."\n";
// }
// }

order_status=>1
currency=>EUR
currency_value=>1.00000000
payment_method=>Credit card (Servired)
cc_type=>
cc_owner=>
cc_number=>
cc_expires=>
shipping_method=>Colissimo Suivi Retour (0.35 g)
shipping_cost=>5.55
subtotal=>4
tax=>0
tax_groups=>Array
comments=>
total=>9.55
--------------------------------- 
insert_id : 19 
sizeof order_totals : 0 

Posted

on the checkout confirmation page, the order totals are displayed perfectly?

 

if yes, please show me the code generating the order totals on that page and the checkout process file up to the order totals first logging section

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...