commerce_product_load_multiple

  1. commerce
    1. 7
Versions
7 commerce_product_load_multiple($product_ids = array(), $conditions = array(), $reset = FALSE)

Loads multiple products by ID or based on a set of matching conditions.

Parameters

$product_ids An array of product IDs.

$conditions An array of conditions on the {commerce_product} table in the form 'field' => $value.

$reset Whether to reset the internal product loading cache.

Return value

An array of product objects indexed by product_id.

See also

entity_load()

▾ 9 functions call commerce_product_load_multiple()

CommerceProductCRUDTestCase::testCommerceProductCrud in modules/product/tests/commerce_product.test
Test the product CRUD functions.
CommerceTaxUIAdminTest::testCommerceTaxUIApplyVAT in modules/tax/tests/commerce_tax_ui.test
Check if a 'VAT' tax type is correctly applied in a given product.
CommerceTaxUIAdminTest::testCommerceTaxUIApplyVATInclusive in modules/tax/tests/commerce_tax_ui.test
Check if a 'VAT' tax type is correctly applied in a given product.
commerce_cart_add_to_cart_form in modules/cart/commerce_cart.module
Builds an Add to Cart form for a set of products.
commerce_cart_field_formatter_view in modules/cart/commerce_cart.module
Implements hook_field_formatter_view().
commerce_product_load in modules/product/commerce_product.module
Loads a product by ID.
commerce_product_load_by_sku in modules/product/commerce_product.module
Loads a product by SKU.
commerce_product_reference_field_formatter_view in modules/product_reference/commerce_product_reference.module
Implements hook_field_formatter_view().
commerce_product_reference_field_widget_form in modules/product_reference/commerce_product_reference.module
Implements hook_field_widget_form().

Code

modules/product/commerce_product.module, line 502

<?php
function commerce_product_load_multiple($product_ids = array(), $conditions = array(), $reset = FALSE) {
  if (empty($product_ids) && empty($conditions)) {
    return array();
  }

  return entity_load('commerce_product', $product_ids, $conditions, $reset);
}
?>