This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:onNewInvoiceItemCopy event

Triggered by Shop_OrderItem
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onNewInvoiceItemCopy(Shop_OrderItem $item, Shop_OrderItem $original_item)
$item Shop_OrderItem specifies the new order item object.
$original_item Shop_OrderItem specifies the original order item object.
Allows to update an order item in a new invoice, when the invoice is created manually in the Administration Area. When users create invoices in the Administration Area, order items are copied from the original order to the invoice. This event allows to update new invoice items before they are saved to the database. The event handler should accept two parameters - the new order item and the old order item.
public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onNewInvoiceItemCopy', $this, 'process_new_invoice_item_copy');
}

public function process_new_invoice_item_copy($item, $original_item)
{
  $item->x_custom_field = 10;
}