THEMING.txt in Ubercart Webform Checkout Pane 7.3
Here is a code snippet that you can use to display Webform pane values into your invoices.
Feel free to edit it to adjust your needs.
=============================================================
== Place the following into your theme/preprocess function ==
=============================================================
<?php
$webformPaneValues = array();
$webforms = _uc_webform_pane_get_nodes();
foreach ($webforms as $webform) {
$components = array();
$nid = $webform->nid;
$node = node_load($nid);
if(FALSE !== $node){
foreach ($node->webform['components'] as $field){
$components[] = array(
'name' => check_plain($field->name),
'value' => ${'order_webform_'.$nid.'_'.$field['form_key']},
);
}
$webformPaneValues[] = array(
'title' => check_plain($node->title),
'components' => $components,
);
}
}
// Now, just pass $webformPaneValues to the template, for example through the template variables
$tplVars = array(
'your-variable-1' => $yourVariable1,
'your-variable-2' => $yourVariable2,
'webformPaneValues' => $webformPaneValues,
);
return theme('your-theme-hook', $tplVars)
?>
====================================================
== Place the following into your invoice template ==
====================================================
<?php if($webformPaneValues): ?>
<table>
<?php foreach($webformPaneValues as $webformPaneValue): ?>
<tr>
<td colspan="2" bgcolor="#006699">
<strong><?php print $webformPaneValue['title']; ?></strong>
</td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<?php foreach ($webformPaneValue['components'] as $component): ?>
<tr>
<td nowrap="nowrap">
<strong><?php print $component['name']; ?>:</strong>
</td>
<td width="98%">
<?php print $component['value'] ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
File
THEMING.txt
View source
- Here is a code snippet that you can use to display Webform pane values into your invoices.
- Feel free to edit it to adjust your needs.
-
- =============================================================
- == Place the following into your theme/preprocess function ==
- =============================================================
- $webformPaneValues = array();
-
- $webforms = _uc_webform_pane_get_nodes();
- foreach ($webforms as $webform) {
- $components = array();
- $nid = $webform->nid;
- $node = node_load($nid);
-
- if(FALSE !== $node){
- foreach ($node->webform['components'] as $field){
- $components[] = array(
- 'name' => check_plain($field->name),
- 'value' => ${'order_webform_'.$nid.'_'.$field['form_key']},
- );
- }
-
- $webformPaneValues[] = array(
- 'title' => check_plain($node->title),
- 'components' => $components,
- );
- }
- }
-
- // Now, just pass $webformPaneValues to the template, for example through the template variables
- $tplVars = array(
- 'your-variable-1' => $yourVariable1,
- 'your-variable-2' => $yourVariable2,
- 'webformPaneValues' => $webformPaneValues,
- );
- return theme('your-theme-hook', $tplVars)
- ?>
-
- ====================================================
- == Place the following into your invoice template ==
- ====================================================
-
-
-