Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hello,

 

I'm trying to round the totals from checkout_confirmation.php the total must be rounded.

i thought maybe this would work checkout_process.php :

 

$sql_data_array = array('orders_id' => $insert_id,

'title' => $order_totals[$i]['title'],

'text' => round((ceil($order_totals[$i]['text']/5)*5),2),

'value' => $order_totals[$i]['value'],

'class' => $order_totals[$i]['code'],

'sort_order' => $order_totals[$i]['sort_order']);

tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);

}

 

this will not word he put not the total in de Db.

And i cant figure out how this works.

I'm not good in Oscommerce so...

Can anyone help me to round the total en put him in my Database and display him at my checkout_confirmation.php.

 

Thanks a lot

Posted

I found it for everybody who likes to know this is the solution:

 

Change this in includes/modules/order_total/ot_total.php:

function process() {

global $order, $currencies;

 

$this->output[] = array('title' => $this->title . ':',

'text' => '<b>' . $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']) . '</b>',

'value' => $order->info['total']);

}

 

By this:

 

function process() {

global $order, $currencies;

$this->output[] = array('title' => $this->title . ':',

'text' => '<b>' . $currencies->format((ceil($order->info['total']/5)*5), true, $order->info['currency'], $order->info['currency_value']) . '</b>',

'value' => $order->info['total']);

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...