commerce_product_load_by_sku

  1. commerce
    1. 7
Versions
7 commerce_product_load_by_sku($sku)

Loads a product by SKU.

▾ 7 functions call commerce_product_load_by_sku()

CommerceProductCRUDTestCase::testCommerceProductCrud in modules/product/tests/commerce_product.test
Test the product CRUD functions.
CommerceProductUIAdminTest::testCommerceProductUIAddProduct in modules/product/tests/commerce_product_ui.test
Test the add product process.
CommerceProductUIAdminTest::testCommerceProductUIEditProduct in modules/product/tests/commerce_product_ui.test
Test the edit process for a product.
CommerceProductUIAdminTest::testCommerceProductUISaveAndAddAnother in modules/product/tests/commerce_product_ui.test
Test the save and add another product.
commerce_cart_rules_product_add_by_sku in modules/cart/commerce_cart.rules.inc
Rules action: adds a product to a user's shopping cart order.
commerce_product_line_item_add_form_submit in modules/product_reference/commerce_product_reference.module
Adds the selected product information to a line item added via a line item manager widget.
commerce_product_reference_autocomplete_validate in modules/product_reference/commerce_product_reference.module
Validation callback for a commerce_product_reference autocomplete element.

Code

modules/product/commerce_product.module, line 481

<?php
function commerce_product_load_by_sku($sku) {
  $products = commerce_product_load_multiple(array(), array('sku' => $sku));
  return $products ? reset($products) : FALSE;
}
?>