将自定义字段添加到 Ubercart 发票
我的客户有一家基于 ubercart 的商店,运作良好。由于一些内部事务,他需要手动向每张发票添加一个字段。我想知道是否或者如何向所有发票上显示的订单添加自定义字段。
My client has an ubercart based shop which works fine. Due to some internal stuff he needs to manually add a field to each invoice. I wanted to know if or rather how i can add a custom field to orders that gets displayed on all the invoices.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个老问题,但这可能对其他人有帮助;您可以使用以下代码。
首先查看位于
ubercart/uc_order/templates
下的customer.itpl.php
或customer.itpl.php
文件。然后,您可以编辑回显所有产品的 foreach 循环,并以这种方式添加您自己的字段:
我的 Ubercart 安装具有可以从
http://www.mysite.com/admin/content/node- 编辑产品字段类型/产品/字段
。您可以找到有关此问题的更多信息。
It's an old question but this may help others; you can use the following code.
First checkout the
customer.itpl.php
orcustomer.itpl.php
files located underubercart/uc_order/templates
.Then you can edit the foreach loop that echoes all the products and add your own fields this way:
My Ubercart installation has the product fields can be edited from
http://www.mysite.com/admin/content/node-type/product/fields
.You can find more information on this issue.
我个人没有必要进行此更改,所以我不是根据经验说话,而是查看文档,我会尝试以下操作:(您可以通过修改现有模块来走捷径并避免一些工作,但这是最干净的我能想到的方式)
这不是一个简单的更改,但使用此模式您将获得所需的修改,而不必担心更新不起作用。
I have not personally had to make this change, so I'm not speaking from experience, but looking at the documentation I would try the following: (you could cut corners and avoid some work by modifying the existing modules, but this is the cleanest way I can think of)
It's not a simple change, but using this pattern you'll get the modification you are looking for without having to worry about updates not working.