Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 503 Vote(s) - 3.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding custom field to Ubercart Invoice

#1
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.
Reply

#2
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)

1. create a module that stores your field and the the order number.
2. using from_alter modify the invoice editing screen to give your users a way to edit the field.
3. use the invoice template to pull in your field, based on the order number. [invoice "system" documentation][1].

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.


[1]:

[To see links please register here]

Reply

#3
It's an old question but this may help others; you can use the following code.

First checkout the `customer.itpl.php` or `customer.itpl.php` files located under `ubercart/uc_order/templates`.

Then you can edit the foreach loop that echoes all the products and add your own fields this way:

<?php
foreach ($order->products as $product) {
$nid = ($product->nid);
$noderef = node_load($nid);
echo $product->title .' : '.$noderef->your_own_field[0]['value'];
echo "<br />";
?>

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](

[To see links please register here]

).
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through