views:

322

answers:

2

I'm using drupal 6.15 with ubercart 2.x and I'm trying to implement ubercart's hook_checkout_pane() to override their default uc_cart_checkout_pane(). I made a function my_module_checkout_pane() in my_module.module and it does get called but the uc_cart version seems to be generating what's actually rendered.

I understand why both functions get called and I can change the order they're called in by modifying my module's weight in the system table but doing so doesn't seem to affect what ends up on the page. Whether my_module's function is called first or second, the uc_cart version is what's rendered. The only way I can get my function to affect the page is to actually alter uc_cart_checkout_pane() so it doesn't return any output but that's not a "good" solution.

Is there some other place I need to do something to make drupal favor my hook implementation over uc_carts'?

Thanks.

edit: Perhaps I should have mentioned what I'm really trying to do is disable some of the default checkout panes - customer information and order comments. If there's another way to do that, that would also solve the problem.

+1  A: 

If I'm not mistaken, hook_checkout_pane is for creating new checkout panes, not overriding default ones. Seems like you'd use hook_checkout_pane to make your own pane and just use that instead? See http://www.ubercart.org/forum/development/11698/alter_checkout_panes

Apologies if I'm mistaken.

Mike Crittenden
That could work if there was an answer to the question posed in the third post - how do you disable the original panes? Post #2 alludes to the possibility but doesn't say how to do it. I tried something like hook_checkout_pane_alter but couldn't make that work. I'm not sure if it's something that exists or if it's just something the poster thinks should exist.
ZorroDeLaArena
you can enable or disable checkout panes in "Checkout settings" <http://www.ubercart.org/docs/user/8396/checkout_settings >. btw: no need to alter module weights, you can do this with pane weights.
ax
Thank you! I'd looked at the checkout settings but didn't see the checkout panes sub-menu.
ZorroDeLaArena
so should i make my comment an answer (which you can accept)?
ax
Yeah, I'd accept it if you did that.
ZorroDeLaArena
done. thank you.
ax
+1  A: 

you can enable or disable checkout panes in "Checkout settings".

btw: no need to alter module weights, you can do this with pane weights.

ax