1

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);

0

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); }

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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