VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: cimeran on February 11, 2013, 17:40:27 PM

Title: getModel('orders') isn't updating the order totals!
Post by: cimeran on February 11, 2013, 17:40:27 PM
Hello. Have an issue with incorrect charges on orders. When a user gets to the payment page, we grab the total from the "orders" model like so:

$orderModel = VmModel::getModel('orders');
$virtuemart_order_id = $orderModel->getOrderIdByOrderNumber($order_number);
$order = $orderModel->getOrder($virtuemart_order_id);
....
$orderTotal = $order['details']['BT']->order_total;

The issue is this. When a user doesn't complete payment, but goes back and edits his/her cart, when we return to the payment page the order total is unchanged. This means we will be under or over charging our customers.

Is the order model cached? Should I be using the cart object to get the total to charge the customer?

Thanks,
Cimeran
Title: Re: getModel('orders') isn't updating the order totals!
Post by: GJC Web Design on February 11, 2013, 17:56:24 PM
Hmm - interesting ..
All the other payment methods are passing in the $order object thru the
function plgVmConfirmedOrder ($cart, $order, $payment_method = '')

and get it by your method  $order['details']['BT']->order_total

have you tried with a vanilla Paypal method - cancel out and retry..?