You are here

function commerce_product_save in Commerce Core 7

Saves a product.

Parameters

$product: The full product object to save.

Return value

SAVED_NEW or SAVED_UPDATED depending on the operation performed.

8 calls to commerce_product_save()
CommerceBaseTestCase::createDummyProduct in tests/commerce_base.test
Creates a dummy product for use with other tests.
CommerceCartTestCaseAnonymousToAuthenticated::testCommerceCartAnonymousToAuthenticated in modules/cart/tests/commerce_cart.test
Test anonymous cart conversion.
CommerceCartTestCaseAttributes::setUp in modules/cart/tests/commerce_cart.test
Implementation of setUp().
CommerceProductCRUDTestCase::testCommerceProductCrud in modules/product/tests/commerce_product.test
Test the product CRUD functions.
CommerceProductCRUDTestCase::testCommerceProductRevisions in modules/product/tests/commerce_product.test
Test product revision management.

... See full list

File

modules/product/commerce_product.module, line 495
Defines the core Commerce product entity, including the entity itself, the bundle definitions (product types), and various API functions to manage products and interact with them through forms and autocompletes.

Code

function commerce_product_save($product) {
  return entity_get_controller('commerce_product')
    ->save($product);
}