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.

Comments

derjochenmeyer’s picture

Version: 6.x-2.2 » 6.x-2.x-dev

+1 for this feature.

Patch tested with ubercart 2.x-dev

longwave’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

Trivial patch, can see its usefulness.

Island Usurper’s picture

Status: Reviewed & tested by the community » Needs work

Needs 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.

longwave’s picture

We could have the best of both worlds with drupal_alter('order_pane_default', $panes) beforehand and drupal_alter('order_pane', $panes) afterwards.

wqmeng’s picture

+1 for this

megachriz’s picture

Status: Needs work » Closed (duplicate)

A better patch can be found here:
#970744: Hook to alter order panes