A couple of different sites that I've maintained have had this issue, and I've decided to post a patch for it in hopes of it becoming standard in Ubercart. In attempts to make changes to the content panes on pages which have no forms to make use of hook_form_alter(), I've had to looked for increasingly more interesting ways to edit and make changes to content panes.
After speaking to togospizza, we came up with the idea of creating our own hook_order_pane_alter(), which will allow you make changes to the panes content before it is submitted and created.
This has been most helpful in allowing me to overload certain ubercart methods which do 99% of what I would like, but the code needs to be slightly tweaked for my clients needs.
| Comment | File | Size | Author |
|---|---|---|---|
| drupal_6-ubercart_2.2-uc_order.order_pane.inc_.patch | 700 bytes | xrampage16 |
Comments
Comment #1
derjochenmeyer commented+1 for this feature.
Patch tested with ubercart 2.x-dev
Comment #2
longwaveTrivial patch, can see its usefulness.
Comment #3
Island Usurper commentedNeeds to be documented in hooks.php.
Also, I want to see what you guys think about putting the alter after 'enabled' and 'weight' have been set. It kind of comes down to who should take precedence: other modules or the end user? I can't think of a specific example, but I think alter hooks can usually override a user setting. Maybe this usually happens with the setting form being altered.
Comment #4
longwaveWe could have the best of both worlds with drupal_alter('order_pane_default', $panes) beforehand and drupal_alter('order_pane', $panes) afterwards.
Comment #5
wqmeng commented+1 for this
Comment #6
megachrizA better patch can be found here:
#970744: Hook to alter order panes