Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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;
}
Comment | File | Size | Author |
---|---|---|---|
#8 | 596740-8-Pass-order-to-theme_uc_cart_complete_sale-D6.patch | 1.25 KB | DeFr |
#4 | 596740-4-Cart-Pass-the-Order-to-the-complete_sale-theme-funct.patch | 910 bytes | DeFr |
Comments
Comment #1
deepeddy CreditAttribution: deepeddy commentedI 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.
Comment #2
shi99 CreditAttribution: shi99 commentedNice suggestion that helped me. Thanks.
Comment #3
TR CreditAttribution: TR commentedTagging and moving to 7.x-3.x.
Comment #4
DeFr CreditAttribution: DeFr commentedPatch for 7.x-3.x attached.
Comment #5
longwaveWould it be even better to split all the message code out of uc_cart_complete_sale() and into one or more new theme functions?
Comment #6
longwaveCommitted.
Comment #7
longwaveI guess this could be backported without breaking compatibility.
Comment #8
DeFr CreditAttribution: DeFr commentedSure, 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 ?
Comment #9
longwaveCommitted to 6.x. Any further change requests for this function in D7 should be in a new issue.