News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

getModel('orders') isn't updating the order totals!

Started by cimeran, February 11, 2013, 17:40:27 PM

Previous topic - Next topic

cimeran

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

GJC Web Design

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

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation