Hi.
I am try add webform_pane data in the invoice.
I am modify function

function uc_webform_pane_order($op, &$arg1, $arg2) {
//skip
    case 'load': 
      include_once(drupal_get_path('module', 'webform') ."/includes/webform.submissions.inc"); 
      $uc_wf_subs = db_query("SELECT nid, sid FROM {uc_webform_pane_submissions} WHERE order_id = %d", $arg1->order_id); 
      while ($uc_wf_sub = db_fetch_object($uc_wf_subs)) { 
        $node = node_load($uc_wf_sub->nid); 
        $submission = webform_get_submission($uc_wf_sub->nid, $uc_wf_sub->sid); 
        $arg1->uc_webform = theme_uc_webform_pane_order_view(_uc_webform_pane_render($node->nid, $arg1->order_id)); 
      } 
    break; 
//skip

and add data to $order->uc_webform object. I's work. I can modify template of invoce and print webform data.
May be you know as send this data without modify template.

Comments

arski’s picture

Title: Webform_pane data in the invoice » Webform pane data in the invoice
Category: feature » support

hmm, which invoice do you mean? there is a page and an email and they're generated by different templates if I'm not mistaken.

Could you give me the link - I don't need the full URL to your site, just the part after / so that I could see the structure.

Thanks

ij3net’s picture

Yes. You are right. It is page's:
/admin/store/orders/64/invoice
/admin/store/orders/64/invoice/mail
/admin/store/orders/64/invoice/print

It is no very important function for this module.
But with it all views of order may be include webform data.
Will be convenient to install it all-in-one. Without editing template.

arski’s picture

Status: Active » Closed (won't fix)

Hey,

I thought you were talking about these pages, just wanted to confirm.

I understand your request and find it a very reasonable and useful one - but unfortunately these pages are independent of the order panes, as the data in them is defined in the specific invoice template file, as you mentioned. As things are, it's impossible to adjust a theme file from within a module, and even if it were, it would make little sense to redefine the whole ubercart template in a custom module - basically if it can't be done by hooks, it shouldn't be done at all..

So I'm afraid you'll still have to add the webform data to your invoice template yourself.. One thing that I could possibly offer, something that has been mentioned before, is to provide some small snippet of code that loops through all webform panes and displays all the fields, just for your reference to make things easier.. but that's about it I'm afraid.

Let me know if that could be something for you.

Cheers,
Martin

werushka’s picture

got a quick question about this matter, it is okey for me to edit the template manually, i have field created "contact_name". I want to show it in invoice $contact_name does not work, how should i put it in .tpl.php so "contact_name" shows in invoice.

arski’s picture

Hey there, this has been discussed in several posts already, so I would advise you to read http://drupal.org/node/792550#comment-3592530 and, if necessary, the link in there.

werushka’s picture

thanks for your quick reply i solved it but forgot to repost