Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SQL - get order_totals to echo


Guest

Recommended Posts

Posted

Hey, I'm using the HTMl Emails extension.

 

I have a variable that is definied for the confirmation email.

for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
$Vartaxe .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
}

 

The Output looks like this when the email is sent from checkout_confirmation:

Sub-Total: 4.48 €

Total: 3.81 €

This is how it should be..

 

Now I switched from an older Paypal Plugin (that was sending out the emails just fine) to the newer "Paypal Standard Website Payments" and added the email parts to /ext/modules/payment/paypal/standard_ipn.php

The Email is sent after the order is completed and there is the product listing in the email and all that.

But there is no order_totals under the product listing.

 

I guess the problem is that $order->totals[$i]['title'] is empty.

I was looking in phpmyadmin, and the "TITLE" in table "ORDERS_TOTAL" is filled.

 

The question is: How do I design the Database Query to get title+text out of the table and into the variable for the email?

I tried alot of stuff, googled, searched the forum, now after 7 hours I don't know what to try further.

I tested some kind of this:

$total_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $order_id . "' and class = 'ot_total' limit 1");
$total = tep_db_fetch_array($total_query);
$Vartaxe .= strip_tags($total->title) . ' ' . strip_tags($total->text) . "\n";

but nothing was leading to the desired output.

Archived

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

×
×
  • Create New...