2 replies [Last post]
spydor@drupal.org's picture
Offline
Joined: 01/20/2008
Juice: 50
Was this information Helpful?

Is there a way to get the order total from within a hook_payment_method function?

Thanks,
Shane

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Glad you asked. I know

Glad you asked. Smiling I know the payment method docs are a little spotty here.

Your second argument should be a reference to the order object. Depending on which $op you're in, it will mostly contain a fully loaded order which includes a property called order_total that you should be able to check like so:

<?php
if ($arg1->order_total > 100) {
  print
'The order is more than $100.';
}
?>
spydor@drupal.org's picture
Offline
Joined: 01/20/2008
Juice: 50
Re: Glad you asked. I know

Thanks Ryan.