When the Review page is being displayed, the cart checkout pane's rows are run through uc_price, but the order isn't being provided as a part of the context of the call. I'll attach a patch shortly which does this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jcfiala’s picture

Status: Active » Needs review
FileSize
1.27 KB

So, here's the patch I created to provide an order context to uc_price - please review.

xurizaemon’s picture

Title: Cart Checkout Pane on Review page does not provide order as part of context to uc_price » Provide order data as context for uc_price (for multicurrency support)
Version: 6.x-2.0 » 6.x-2.x-dev
FileSize
12.08 KB

Re-rolling against current Ubercart and attaching changes from http://www.vintagedigital.net/content/how-add-multicurrency-support-uber... as well.

This patch sets $context['subject']['order'] = $order for each core UC payment module, and in a few other locations where uc_price() might need the contextual data to set price information based on the order details.

The benefit of doing this is that the order can store currency information, and the displayed price reflect the currency which the order occurred in.

I have not looked into why this patch does this, though:

@@ -377,7 +380,7 @@ function uc_payment_get_totals($return = FALSE, $order = NULL) {
 
     $context['revision'] = 'themed';
     $context['type'] = 'amount';
-    unset($context['subject']);
+    unset($context['subject']['line_item']);
     $output .= '<tr><td align="right"><b>'. t('Order total:') .'</b></td>'
               .'<td align="right">'. uc_price(uc_order_get_total($order), $context)
               .'</td></tr></table>';
xurizaemon’s picture

Issue tags: +multicurrency

Currently testing this code in line with development on a multicurrency payment gateway for Ubercart.

xurizaemon’s picture

Hmm. Possibly duplicated by existing work on #1097668: Multicurrency support as well.

Status: Needs review » Needs work

The last submitted patch, ubercart-621494-provide_order_context_to_uc_price.patch, failed testing.

longwave’s picture

Status: Needs work » Closed (duplicate)

If this is to be solved in 6.x it will be done in #1097668: Multicurrency support