commerce_product_load

  1. commerce
    1. 7
Versions
7 commerce_product_load($product_id)

Loads a product by ID.

▾ 10 functions call commerce_product_load()

CommerceBaseTestCase::assertProductCreated in tests/commerce_base.test
Asserts that a product has been created.
CommerceBaseTestCase::createDummyOrder in tests/commerce_base.test
Create a dummy order in a given status.
CommerceProductCRUDTestCase::testCommerceProductCrud in modules/product/tests/commerce_product.test
Test the product CRUD functions.
CommerceProductUIAdminTest::testCommerceProductUIDeleteProduct in modules/product/tests/commerce_product_ui.test
Test deleting a product.
commerce_cart_add_to_cart_form_submit in modules/cart/commerce_cart.module
Form submit handler: add the selected product to the cart.
commerce_cart_handler_field_add_to_cart_form::render in modules/cart/includes/views/handlers/commerce_cart_handler_field_add_to_cart_form.inc
Render an element.
commerce_cart_product_add_by_id in modules/cart/commerce_cart.module
Adds the specified product to a customer's shopping cart by product ID.
commerce_order_update_7100 in modules/order/commerce_order.install
Loads and resaves all the products on the site, updating the default price field to have proper component price amount values.
commerce_product_pre_calculate_sell_prices in modules/product_pricing/commerce_product_pricing.module
Pre-calculates sell prices for qualifying products based on valid rule configurations on the "Calculating product sell price" event.
commerce_product_ui_help in modules/product/commerce_product_ui.module
Implements hook_help().

Code

modules/product/commerce_product.module, line 469

<?php
function commerce_product_load($product_id) {
  if (empty($product_id)) {
    return FALSE;
  }

  $products = commerce_product_load_multiple(array($product_id), array());
  return $products ? reset($products) : FALSE;
}
?>