You are here

function commerce_line_item_save in Commerce Core 7

Saves a line item.

Parameters

$line_item: The full line item object to save.

Return value

SAVED_NEW or SAVED_UPDATED depending on the operation performed.

7 calls to commerce_line_item_save()
commerce_cart_handler_field_edit_attributes::views_form in modules/cart/includes/views/handlers/commerce_cart_handler_field_edit_attributes.inc
Returns the form which replaces the placeholder from render().
commerce_cart_order_refresh in modules/cart/commerce_cart.module
Refreshes the contents of a shopping cart by finding the most current prices for any product line items on the order.
commerce_cart_product_add in modules/cart/commerce_cart.module
Adds the specified product to a customer's shopping cart.
commerce_line_item_handler_field_edit_quantity::views_form_submit in modules/line_item/includes/views/handlers/commerce_line_item_handler_field_edit_quantity.inc
commerce_line_item_manager_validate in modules/line_item/commerce_line_item.module
Validation callback for a commerce_line_item_manager element.

... See full list

File

modules/line_item/commerce_line_item.module, line 600
Defines the core Commerce line item entity and API functions interact with line items on orders.

Code

function commerce_line_item_save($line_item) {
  return entity_get_controller('commerce_line_item')
    ->save($line_item);
}