titel says it all.

We ask them some questions and want the questens and the anser shown on the invoice to.

kind regards

Comments

arski’s picture

Hey,

The Ubercart invoice is an annoying thing as it's a itpl.php file with tokens in it and very little dynamic stuff. Basically the whole invoice is predefined and doesn't have the possibility to accept new fields, which is annoying.

What you can do is create your own invoice.itpl.php (you can then set that template as the default one for customers) and add something like the following inside the "foreach ($order->products as $product) {" loop :

$webforms = _uc_webform_pane_get_nodes('INNER');
foreach($webforms as $wf) {

if ($wf->form_key_order_id) {
$wf_data = _uc_webform_pane_get_data($wf->nid, $order->order_id);

and then iterate through every part of wf_data and display it.. in the table..

I know it's not pretty but that's the best I can offer given what UC allows to do. Maybe if more people are interested I could provide a sample template file which you could use as a default one..

Let me know if this helps.

Cheers,
Martin

arski’s picture

Title: Posibility to show the filied in data of the webform in the infoice and other panes » Show webform data on invoices
Category: task » feature
arski’s picture

Title: Show webform data on invoices » Show webform data in Ubercart templates (used for invoices, notifications emails)

The templates are responsible for both invoices and emails to customers/admins, so this issue should take care of all of the above.

There has been a proposal to introduce tokens here #758114: create order tokens and one to make this more dynamic in the first comment. Please leave your pro/cons for the proposals and we'll make something out of it :)

Thanks!

jazzitup’s picture

+1 subscribed

E-mail notification is a very useful feature and I was really surprised it's not included in the current stable release already.
My vote goes to make things more dynamic, but maybe we should talk with UC Invoice developers to make it more flexible in the first place?

ikeigenwijs’s picture

I ll try to make something of it next week.
Thx for pointing me in the right direction.
I ll be back.

jazzitup’s picture

Excellent! Please give us an update with your progress.

arski’s picture

Hey,

sounds good :) If you want to talk to UC developers go ahead - I'm sure it's going to be a long conversation so I'd prefer to sit and listen, but if you make any progress let me know ;)

Cheers

ikeigenwijs’s picture

no progress so far,
I still need it, but have not find the time yet.
And it does not look bright in the future. Its on the list, but i cant put a time on it sorry.
kind regards, and hopefully until the near future.

jasom’s picture

Title: Show webform data in Ubercart templates (used for invoices, notifications emails) » Show webform data in UbAlso needed thisercart templates (used for invoices, notifications emails)

Webform submission tokens are very welcome feature for me. This is nice and powerful module but tokens are its biggest minus.

arski’s picture

Title: Show webform data in UbAlso needed thisercart templates (used for invoices, notifications emails) » Show webform data in Ubcart templates (used for invoices, notifications emails)

changed the title back :x

arski’s picture

Title: Show webform data in Ubcart templates (used for invoices, notifications emails) » Show webform data in Ubercart templates (used for invoices, notifications emails)

deleted a little too much :)

gausarts’s picture

Subscribing. Thanks

arski’s picture

Assigned: Unassigned » arski

Hey guys,

Thanks for all the comments. Due to a high number of changes in the current dev version, I will be releasing the next version around next week without tokens. However, they are first on the list for next release. Any contributions welcome as always. Sorry for the delay :)

Cheers

zkrebs’s picture

This would be cool vs. this : http://drupal.org/node/831134#comment-3273880

arski’s picture

Hey,

Thanks for the note, I was looking for a module like that recently but couldn't find anything. Is it any good? I see there is a big discussion going on about changing it completely..

I'll get on to tokens soon enough I hope.. very busy days now :(

Cheers,
Martin

zkrebs’s picture

I have just used your module to complete 99% of what I need, is there any way you could provide that template for ubercart 2.2? It would be nice to look just like the default template, plus the little box with my extra fields :)

And to reply to your previous question, after finding your module and using webform, it solves the main need of extra fields. It does it easily, and there's no need to recreate extra field capacity in the uc_extra_fields_pane module, except for Address Fields it seems.

arski’s picture

Hey, glad you liked the module.

I'll give you tokens ASAP, I know a lot of people are waiting on it :)

Yea, that other module really makes sense for extending existing panes only, like address fields and such.. for anything additional I would guess that this is much more powerful and nicer to work with.

Cheers

arski’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Status: Active » Needs review

All righty, token support is here!

It's in the dev version for now (online within 12 hours), would be great if someone else tested it out to see if I missed something. All the tokens should be listed in admin/store/help/tokens and can be used in the UC templates (which can be now themed since the introduction of Ubercart 2.3!!! took them only XYZ years to add that..)

Enjoy and let me know how it works.

Cheers,
Martin

zkrebs’s picture

Hope to test soon, I am still waiting to upgrade my site to 2.3

arski’s picture

Status: Needs review » Fixed

This is all good as far as I'm aware.

MBroberg’s picture

Wonderful! Could you please provide a sample of a modified template that includes the webform tokens?
I understand how to change the invoices for Ubercart, but I need to be able to include the webform data in the invoice emails and online.
I can see the tokens at the help link provided, but no idea what to do to get them to show up.

A sample invoice taken straight from Ubercart and modified to show a few webform fields would be super!

arski’s picture

Hey,

well it's really very easy, all you need to do is take those tokens and put them inside your invoice template somewhere.. so the invoice has some things like price, buyer name etc etc in square brackets, you just copy-past the webform tokens into your template and you're done. There is really no point in providing an extra example - the ubercart default template has enough examples (read "tokens") in it, so all you need is some basic HTML knowledge to extend it, no PHP necessary.

Hope this helps.

Cheers

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

piebuo’s picture

I have the same problem and i don't understand how to add webform in template. Can you post me the code i have to insert in the template?
Thank you very much for your help

arski’s picture

Hey there,

the available tokens are listed under admin/store/help/tokens - the ones that begin with uc_webform are the webform checkout pane tokens. You can then put these tokens as variables in any one of your templates, just make sure to replace the minus signs from the [this-style-token] with an underscore when using them as a variable in UC templates - $this_style_token.

For more details, suggestions and problems, please read #912868: Tokens do not render correct Webform data on Invoice Page and post any follow-up issues in there. Thanks!

Martin