Skip to content

Instantly share code, notes, and snippets.

@webmasterkai
Created November 15, 2012 16:41
Show Gist options
  • Save webmasterkai/4079628 to your computer and use it in GitHub Desktop.
Save webmasterkai/4079628 to your computer and use it in GitHub Desktop.
adding order props to webform submission
diff --git a/uc_webform.module b/uc_webform.module
index 4c45523436add444bfa921038aec5458070708de..77317ad9d47a22cdc808eead0874fa468ff12377 100644
--- a/uc_webform.module
+++ b/uc_webform.module
@@ -606,7 +606,23 @@ function uc_webform_order($op, &$arg1, $arg2) {
$webform_node = node_load($product->data['webform_nid']);
$webform_submission = webform_menu_submission_load($product->data['webform_sid'], $product->data['webform_nid']);
if (count($webform_node->webform['components'])) {
+ $order_properties = array(
+ 'billing_first_name',
+ 'billing_last_name',
+ 'primary_email',
+ 'uid',
+ 'billing_phone',
+ 'billing_company',
+ 'billing_street1',
+ 'billing_city',
+ 'billing_postal_code',
+ 'order_id',
+ );
foreach ($webform_node->webform['components'] as $component) {
+ if (in_array($component['form_key'], $order_properties)) {
+ $webform_submission->data[$component['cid']]['value'][0] = $arg1->{$component['form_key']};
+ webform_submission_update($webform_node, $webform_submission);
+ }
if ($component['form_key'] == 'order_status') {
$webform_submission->data[$component['cid']]['value'][0] = $status;
webform_submission_update($webform_node, $webform_submission);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment