Revision: 35979
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 15, 2010 22:02 by jjensen90
Initial Code
if ($order->product_count == 1) { $form_state = array(); module_load_include('inc', 'node', 'node.pages'); // new for Drupal 6 $nodeTmp = array('type' => 'order'); // a variable holding the content type $form_state['values']['type'] = 'order'; // the type of the node to be created $form_state['values']['status'] = 1; // set the node's status to Published, or set to 0 for unpublished $form_state['values']['title'] = 'Some Node Title Here'; // the node's title // here is the problem. trying to access the array in the previous snipplr link. $form_state['values']['body'] = $updated_order->products[0]->data->attributes['project'][0];// NOT WORKING at the moment. returns empty. drupal_set_message('<pre>'. print_r($updated_order, TRUE) .'</pre>'); // the body, not required $form_state['values']['name'] = 'jacobj'; $form_state['values']['op'] = t('Save'); // this seems to be a required value // call the function to create the node, node_revisions, and CCK values. // Replace "story" with the name of your form / content type $errs = drupal_execute('order_node_form', $form_state, (object) $nodeTmp); }
Initial URL
Initial Description
Initial Title
drupal ubercart create node script
Initial Tags
Initial Language
PHP