如何主题化 Ubercart Checkout Complete 页面

发布于 2024-12-22 12:50:58 字数 256 浏览 3 评论 0原文

我想主题页面 /cart/checkout/complete

我已经在 admin/store/settings/checkout/settings 中看到了设置,但它们还不够。 我想添加一些 HTML,即在页面顶部添加一个打印按钮。

我想要一个 .tpl.php 文件用作模板,或者使用备用结帐页面,如何插入结帐设置中定义的文本。

我试图制作 uc_cart_complete_sale.tpl.php 但它没有被调用。

先感谢您。

I want to theme the page /cart/checkout/complete

I already saw the settings in admin/store/settings/checkout/settings, but they are not enough.
I want to add some HTML i.e. add a print button at the top of the page.

I would like to have a .tpl.php file to use as template, or otherwise, using an alternate checkout page, how to insert the texts defined in checkout settings.

I tried to make a uc_cart_complete_sale.tpl.php but it isn't called.

Thank you in advance.

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

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

发布评论

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

评论(4

迷雾森÷林ヴ 2024-12-29 12:50:58

根据 模板建议文档,您可以为任何路径提供自定义 page.tpl.php,因此具有以下名称的模板文件将覆盖路径 cart/checkout/completepage.tpl.php

page--cart--checkout--complete.tpl.php

创建文件后请务必清除 Drupal 的缓存,以便的变化在主题注册表中获取。

According to the Template Suggestion documentation you can provide a custom page.tpl.php for absolutely any path, so a template file with the following name would override page.tpl.php for the path cart/checkout/complete:

page--cart--checkout--complete.tpl.php

Be sure to clear Drupal's cache once you've create the file so the changes are picked up in the theme registry.

云醉月微眠 2024-12-29 12:50:58

经过一番努力,我找到了模板页面。

就是:

page--cart--checkout--complete.tpl.php

记得清除缓存

After hard work, i found the template page.

It is:

page--cart--checkout--complete.tpl.php

remember to clear the cache

行至春深 2024-12-29 12:50:58

首先,您应该检查此页面:admin/store/settings/checkout/edit/messages

在那里您可以自定义结帐完成时显示的消息的标题。

除此之外,您还可以实现一些功能来更改此页面。从 ubercart api 的简短外观来看,也许这个函数可以: my_module_checkout_complete() in 此链接家伙说它有效

另一个应该有效的功能是theme_uc_cart_complete_sale

还有其他选项,例如在你的 template.php 中检查这是否是 /checkout /完成并做任何你想做的事。像这样:

if (arg(0) == 'cart' && arg(1) == 'checkout' && arg(2) == 'complete')

然后重定向到您的页面。无论如何,有很多方法可以实现这一点,但仅仅将文件命名为“uc_cart_complete_sale.tpl.php”是行不通的。对不起...

firstly, you should probably check this page: admin/store/settings/checkout/edit/messages

there you can customize a header for the message displayed when the checkout completes.

other than that, you can implement some functions to alter this page. from a short look in the ubercart api maybe this function will do: my_module_checkout_complete() in this link the guy says it worked

another function that should work is theme_uc_cart_complete_sale

there are other options, such as in your template.php check if this is /checkout/complete and do whatever you want. like this:

if (arg(0) == 'cart' && arg(1) == 'checkout' && arg(2) == 'complete')

and than redirect to your page. anyway, there are plenty of ways to accomplish this, but just naming a file 'uc_cart_complete_sale.tpl.php' won't work. sorry...

愿得七秒忆 2024-12-29 12:50:58

至少在 D6 中,您可以通过重写 theme_uc_cart_complete_sale() 来对消息进行主题化 - 因此,如果这就是您所追求的,请通过在主题中重写该消息来对消息进行主题化(例如, function mytheme_uc_cart_complete_sale($message, $order) {}

In D6 at least, you can theme the message by overriding theme_uc_cart_complete_sale() - so if that's what you're after, theme the message by overriding that in your theme (for example, function mytheme_uc_cart_complete_sale($message, $order) {}

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