LemonStand Documentation

shop:onNewInvoiceItemCopy event

The shop:onNewInvoiceItemCopy event 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. Both objects are instances of the Shop_OrderItem class. 

Event handler example:

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;
}

Next: shop:onInvoiceSystemSupported event
Previous: shop:onOrderStatusChanged event
Return to Handling LemonStand events