Created
October 26, 2010 09:01
-
-
Save flevour/646565 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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