To give themers more options, in uc_cart_complete_sale(), change

-  $themed_output = theme('uc_cart_complete_sale', $output_message);
+  $themed_output = theme('uc_cart_complete_sale', $output_message, $order);

and later

-function theme_uc_cart_complete_sale($message) {
+function theme_uc_cart_complete_sale($message, $order) {
   return $message;
 }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

deepeddy’s picture

I just made exactly this same patch to my local copy of uc_cart.module. this is a "me too" on making this rather minor change.

shi99’s picture

Nice suggestion that helped me. Thanks.

TR’s picture

Version: 6.x-2.0-rc7 » 7.x-3.x-dev
Issue tags: +Ubercart theme layer

Tagging and moving to 7.x-3.x.

DeFr’s picture

Status: Active » Needs review
FileSize
910 bytes

Patch for 7.x-3.x attached.

longwave’s picture

Would it be even better to split all the message code out of uc_cart_complete_sale() and into one or more new theme functions?

longwave’s picture

Status: Needs review » Fixed

Committed.

longwave’s picture

Version: 7.x-3.x-dev » 6.x-2.x-dev
Status: Fixed » Patch (to be ported)

I guess this could be backported without breaking compatibility.

DeFr’s picture

Status: Patch (to be ported) » Needs review
FileSize
1.25 KB

Sure, patch for 6.x-2.x attached.

With regards to #5, I think it might make sense for D7 to use the fact that theme functions can now be preprocess to, and thus the whole building of the messages array, the filter_xss call and the final concatenation in a new preprocess function. Giving the array meaningfull keys instead of using automatic numeric key might help to. Then, the preprocess function adds both the keyed messages array and the simple concatenation to the variables, and then if you want to remove some specific part of the message, then you can just unset the corresponding key in the message array in your own preprocess function, rebuild the concatenation and be done with it. Would that make sense ?

longwave’s picture

Status: Needs review » Fixed

Committed to 6.x. Any further change requests for this function in D7 should be in a new issue.

Status: Fixed » Closed (fixed)
Issue tags: -Ubercart theme layer

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