Skip to content

Instantly share code, notes, and snippets.

@flevour
Created October 26, 2010 09:01
Show Gist options
  • Save flevour/646565 to your computer and use it in GitHub Desktop.
Save flevour/646565 to your computer and use it in GitHub Desktop.
<?php
/**
* Carica un prodotto in base al modello. Ispirato da uc_ajax_cart_add_item()
* @param unknown_type $model
* @return unknown_type
*/
function uc_product_load_by_model($model) {
$product = db_fetch_object(db_query('SELECT vid, model, list_price, cost, sell_price, weight, weight_units, length, width, height, length_units, pkg_qty, default_qty, unique_hash, ordering, shippable FROM {uc_products} WHERE model = "%s"', $model));
$node = node_load(array('vid' => $product->vid));
uc_product_load($node);
return $node;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment