function uc_product_get_attributes in Ubercart 6.2
Same name and namespace in other branches
- 8.4 uc_attribute/uc_attribute.module \uc_product_get_attributes()
- 5 uc_attribute/uc_attribute.module \uc_product_get_attributes()
- 7.3 uc_attribute/uc_attribute.module \uc_product_get_attributes()
Loads all attributes associated with a product node.
8 calls to uc_product_get_attributes()
- UbercartCartLinksTestCase::createValidCartLinks in uc_cart_links/
uc_cart_links.test - Creates cart links pointing to the given product(s).
- uc_attribute_nodeapi in uc_attribute/
uc_attribute.module - Implements hook_nodeapi().
- uc_catalog_buy_it_now_form_validate in uc_product/
uc_product.module - Redirects to the product page if attributes need to be selected.
- uc_object_attributes_form in uc_attribute/
uc_attribute.admin.inc - Form to associate attributes with products or classes.
- uc_object_options_form in uc_attribute/
uc_attribute.admin.inc - Form to assign and modify attribute options on products or classes.
File
- uc_attribute/
uc_attribute.module, line 1187
Code
function uc_product_get_attributes($nid) {
$attributes = array();
$result = db_query("SELECT upa.aid FROM {uc_product_attributes} AS upa LEFT JOIN {uc_attributes} AS ua ON upa.aid = ua.aid WHERE upa.nid = %d ORDER BY upa.ordering, ua.name", $nid);
while ($attribute = db_fetch_object($result)) {
$attributes[$attribute->aid] = uc_attribute_load($attribute->aid, $nid, 'product');
}
return $attributes;
}