控制 UberCart 结帐窗格挂钩优先级

发布于 2024-08-19 09:39:36 字数 508 浏览 3 评论 0原文

我将 Drupal 6.15 与 ubercart 2.x 结合使用,并尝试实现 ubercart 的 hook_checkout_pane() 来覆盖其默认的 uc_cart_checkout_pane()。我的目标是禁用一些默认的结帐窗格 - 客户信息和订单评论。

我在 my_module.module 中创建了一个函数 my_module_checkout_pane() ,它确实被调用,但 uc_cart 版本似乎正在生成实际渲染的内容。

我理解为什么这两个函数都会被调用,并且我可以通过修改系统表中模块的权重来更改它们的调用顺序,但这样做似乎不会影响页面上的最终结果。无论 my_module 的函数是首先调用还是第二次调用,都会呈现 uc_cart 版本。我可以让我的函数影响页面的唯一方法是实际更改 uc_cart_checkout_pane() ,这样它就不会返回任何输出,但这不是一个“好的”解决方案。

我是否需要在其他地方做一些事情来使 Drupal 比 uc_carts 更有利于我的钩子实现?或者,还有其他方法可以实现此目的吗?

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(). My goal is to disable some of the default checkout panes - customer information and order comments.

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'? Alternatively, is there another way to accomplish this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

少女七分熟 2024-08-26 09:39:36

您可以在“结帐设置”中启用或禁用结帐窗格。

顺便说一句:无需更改模块权重,您可以使用窗格权重来做到这一点。

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

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

妄司 2024-08-26 09:39:36

如果我没记错的话,hook_checkout_pane 用于创建新的结帐窗格,而不是覆盖默认窗格。似乎您会使用 hook_checkout_pane 来制作自己的窗格并直接使用它?请参阅http://www.ubercart.org/forum/development/11698/alter_checkout_panes

如果我弄错了,请道歉。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文