function uc_order_update_line_item in Ubercart 8.4
Same name and namespace in other branches
- 5 uc_order/uc_order_line_item.inc \uc_order_update_line_item()
- 6.2 uc_order/uc_order.line_item.inc \uc_order_update_line_item()
- 7.3 uc_order/uc_order.line_item.inc \uc_order_update_line_item()
Updates a line item.
4 calls to uc_order_update_line_item()
- LineItems::submitForm in uc_order/
src/ Plugin/ Ubercart/ OrderPane/ LineItems.php - Form submission handler.
- QuotePane::prepare in shipping/
uc_quote/ src/ Plugin/ Ubercart/ CheckoutPane/ QuotePane.php - Prepares a pane for display.
- Quotes::applyQuote in shipping/
uc_quote/ src/ Plugin/ Ubercart/ OrderPane/ Quotes.php - Ajax callback: Manually applies a shipping quote to an order.
- uc_tax_uc_order_update in uc_tax/
uc_tax.module - Implements hook_uc_order_update().
File
- uc_order/
uc_order.line_item.inc, line 16 - Callbacks and helper functions for the default order line items.
Code
function uc_order_update_line_item($id, $title, $amount, $data = NULL) {
$fields = [
'title' => $title,
'amount' => $amount,
];
if (!is_null($data)) {
$fields['data'] = serialize($data);
}
db_update('uc_order_line_items')
->fields($fields)
->condition('line_item_id', $id)
->execute();
return TRUE;
}