Drupal Ubercart: error in passing values back to the Content Type after checkout
- by user512826
I am trying to set up event registration in a drupal site using Ubercart + the UC Node Checkout Module.
I have followed the instructions provided in http://drupaleasy.com/blogs/ultimike/2009/03/event-registration-ubercart.
However I seem to be unable to pass the Order ID and Payment Status back to the node.
I have created a conditional action that on node checkout executes the following PHP code:
I am using the following code to update the node on checkout - but nothing happens:
if (isset($order)) {
foreach ($order->products as $product) {
if (isset($product->data['node_checkout_nid'])) {
$node = node_load($product->data['node_checkout_nid']);
$node->field_status['0']['value'] = 1;
$node->field_orderid['0']['value'] = $order->order_id;
node_save($node);
}
}
}
I know the conditional action is working because it prints dsm('hello world') messages on node checkout - however when I include a dsm($node) or dsm($product) in the PHP code, they return blank.
Also when I go back to my product and click the 'Devel' tab, the 'data' string contains the following characters: a:1:{s:13:"form_build_id";s:37:"form-3ccc03345f4832c69666a89c560de940";}
In this link http://www.ubercart.org/forum/support/10951/node_checkout_issue I found someone else with the same issue, but I have been unable to replicate his solution. Can anybody please help?
Thanks so much!