Closed (fixed)
Project:
UC Node Checkout
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2009 at 14:30 UTC
Updated:
16 Dec 2009 at 15:32 UTC
I fight with the following: when an anonymous user creates a node and saves it a product is added to the cart. When this user goes to checkout, he can choose username and password on his own or a new account is created. My problem: when he finishes payments I found the following way to change some things on the originally created node of this customer using conditional actions and the following code:
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);
}
}
}
Found here: http://drupaleasy.com/blogs/ultimike/2009/03/event-registration-ubercart
Here I would like to add adtionally the name of the new user account to the node/ the user ID of the customer as the authors ID to the node. Has anyone an idea, how I can do this?
Comments
Comment #1
tobiberlinhi,
I found the sollution:
Comment #3
fletch11 commentedThanks a lot - I was trying to figure this out for a while - can't believe it's so simple. Really useful if you have a classified type system and want to enable anonymous users to post stuff but then be able to edit in the future.