function uc_order_delete_line_item in Ubercart 7.3
Same name and namespace in other branches
- 8.4 uc_order/uc_order.line_item.inc \uc_order_delete_line_item()
- 5 uc_order/uc_order_line_item.inc \uc_order_delete_line_item()
- 6.2 uc_order/uc_order.line_item.inc \uc_order_delete_line_item()
Deletes a specific line item, or every line item in an order.
Parameters
$id: The line item ID, or order ID.
$order_id: If FALSE, deletes the line item with the specified ID (default). If TRUE, deletes all line items on the order with the specified ID.
4 calls to uc_order_delete_line_item()
- uc_cart_checkout in uc_cart/
uc_cart.pages.inc - Displays the cart checkout page built of checkout panes from enabled modules.
- uc_order_delete in uc_order/
uc_order.module - Entity API "deletion callback" for uc_order entity.
- uc_order_pane_line_items_remove in uc_order/
uc_order.order_pane.inc - Order pane submit callback: Remove a line item from an order.
- uc_taxes_uc_order in uc_taxes/
uc_taxes.module - Implements hook_uc_order().
File
- uc_order/
uc_order.line_item.inc, line 91 - Contains the callbacks for the default line items for orders and the various functions that make line items work.
Code
function uc_order_delete_line_item($id, $order = FALSE) {
if ($order === FALSE) {
db_delete('uc_order_line_items')
->condition('line_item_id', $id)
->execute();
}
else {
db_delete('uc_order_line_items')
->condition('order_id', $id)
->execute();
}
return TRUE;
}