How to load Product from nid
开发者_如何学运维How Can I load a Product from the db based on the nid?
$product = db_fetch_object(db_query("SELECT * FROM {uc_products} WHERE nid = '%s'", *nid here*)); print_r($product);
Doing a direct db call is an option; however, it is not the Drupal way and does not utilize the benefits of fields, revisions, etc that Drupal's node/CCK system offers. Since uc_products are nodes in Drupal, simply call:
$product = node_load($nid);
精彩评论