5 replies [Last post]
anstosser's picture
Offline
Joined: 08/06/2008
Juice: 27
Was this information Helpful?

Hey guys,

is there a way to alter existing checkout panes?

Due to some customizations I need to hook into the cart checkout pane. I tried to use my modules own hook_checkout_pane, but there you can just define your own panes. No way to list (and change) the other ones.

Calling _checkout_pane_list() ends up in wsod.

Alternatively I make my own cart (no way to edit cart display) pane. Therefore I need to disable the original. But this doesn´t work either.

Last chance to get stuff working is to edit the core code, but this is poor.

Any help is much appreciated.

greetz alex

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Alter checkout panes

Hey Alex, welcome to one of my least favorite parts of the code atm. I'm actually working to rethink the way checkout panes work and have some concept code that I showed screenies of not too long ago. The new system will be easier to alter, but the existing one is not. Your best bet would be to use hook_checkout_pane() to define your own, but instead of starting from scratch, copy the core checkout panes into your module and alter them there as need be. Just give them different IDs and you can disable the core panes and use your alternate versions.

anstosser's picture
Offline
Joined: 08/06/2008
Juice: 27
Hey Ryan, thanks for the

Hey Ryan,

thanks for the quick reply!
Yes, I made a new pane (works excellent! I like the $op var *:-)*).
But I didn´t find the way to disable orig panes? Where is it?
Smiling greetz alex

btw: ubercart is perhaps the most practicle open source shop system/api!
Great great work!

anstosser's picture
Offline
Joined: 08/06/2008
Juice: 27
Re: Hey Ryan, thanks for the

If I got it right, the panes work a bit like the form api. At least the $contents array-keys look like usual forms.
Perhaps it would be fine to define the entire hook as something like the drupal form altering process.
So there could be a $panes argument wich is passed to hook_checkout_pane. And altering the pane like this:

hook_checkout_pane_alter($panes){
$panes['cart_pane']['weight'] => -5;
}

Or directly within hook_checkout_pane.

ñull@drupal.org's picture
Offline
Joined: 01/26/2009
Juice: 114
Just wondering...

...did anything move in this area or do I need to wait for Drupal 7 and the new commerce? But that would not be an easy upgrade just for a small change in one of the check-out panes.

longwave's picture
Offline
Joined: 09/20/2008
Juice: 487
Re: Just wondering...

hook_checkout_pane_alter() was added in Ubercart 2.3, see http://api.lullabot.com/hook_checkout_pane_alter

--
These forums are for general support questions about Ubercart.
Bug reports and feature requests should be posted at http://drupal.org/project/issues/ubercart
Latest API documentation can be found at http://api.ubercart.me/