How do you get a node ID from any of the products in an ubercart order?

I'm trying to get the product author's (uid) from the order as shown below

The order will only contain nodes/products by the same author so a node ID from any of the products in the order will do.

$sid = db_query("SELECT uid FROM {node} WHERE nid = :nid", array(':nid' => $product->nid))->fetchField();

$seller = user_load($sid);


1 Answer 1


I should have been clearer, its ubercart marketplace.

I got it to work this way:

$items = uc_cart_get_contents(); foreach ($items as $item) { $product = node_load($item->nid); }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.