I would like to have the uc_payment_get_totals() function to be able to return the result optionally.

Like:

uc_payment_get_totals($return = false){

...//...

  if($return){
    return$ output;
  }
  print $output;
  exit();
}

Now I have to duplicate this, because I want to use the result of this as a part of a rendered page.

CommentFileSizeAuthor
#6 screenshot_001.png166.48 KBMac Ryan
#2 uc_payment_get_totals.patch1.59 KBrszrama

Comments

keesje’s picture

Typo: return$ output; must be return $output;

And you will need to supply the $totals array also as an optional parameter.

rszrama’s picture

Status: Active » Fixed
StatusFileSize
new1.59 KB

I've rolled your changes (also addressing your e-mailed concern) into this patch. I also included an optional order variable in the event that someone wants to use this function w/o posting in an order variable.

keesje’s picture

Thanks for your patch, I will look into this soon.

For anyone interested, we will use this for prefilling the order preview pane with a form_alter. This way clients without javascript support will be able to see a proper order preview initially. This might not be usefull in some circumstances, but i find the default "javascript must be enabled" message quite user unfriendly. This also makes the checkout more friendly for mobile devices and slow connections.

rszrama’s picture

Ahh, very interesting. That's definitely a problem we'll have to address in the next version.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Mac Ryan’s picture

Status: Closed (fixed) » Needs work
StatusFileSize
new166.48 KB

I am not sure this is the right place to post this, but since I upgraded RC7 -> 2.0 I get the following error in the "payment method" panel of the checkout page:

Fatal error: Unsupported operand types in sites/all/modules/ubercart/uc_order/uc_order.module on line 1459

I noticed that this is the uc_order_get_total() function that has been affected by said upgrade, so I thought that some changes could have caused this?

rszrama’s picture

Status: Needs work » Closed (fixed)

There's an issue with that exact title. See my patch in comment 71.

#611044: Fatal error: Unsupported operand types in .../uc_order.module on line 1459