如何主题化 Ubercart Checkout Complete 页面
我想主题页面 /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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
根据 模板建议文档,您可以为任何路径提供自定义 page.tpl.php,因此具有以下名称的模板文件将覆盖路径
cart/checkout/complete
的page.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 pathcart/checkout/complete
:Be sure to clear Drupal's cache once you've create the file so the changes are picked up in the theme registry.
经过一番努力,我找到了模板页面。
就是:
记得清除缓存
After hard work, i found the template page.
It is:
remember to clear the cache
首先,您应该检查此页面:admin/store/settings/checkout/edit/messages
在那里您可以自定义结帐完成时显示的消息的标题。
除此之外,您还可以实现一些功能来更改此页面。从 ubercart api 的简短外观来看,也许这个函数可以: my_module_checkout_complete() in 此链接家伙说它有效
另一个应该有效的功能是theme_uc_cart_complete_sale
还有其他选项,例如在你的 template.php 中检查这是否是 /checkout /完成并做任何你想做的事。像这样:
然后重定向到您的页面。无论如何,有很多方法可以实现这一点,但仅仅将文件命名为“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:
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...
至少在 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) {}