shop:onGetOrderItemDisplayDetails event
The shop:onGetOrderItemDisplayDetails event allows to display custom information about an order item in the Administration Area, for example on the Order Preview page. The event handler should accept two parameters - the order item object (Shop_OrderItem), and a flag indicating whether the string should be returned in HTML or plain text format.
Event handler example. Similar code used in the Subscriptions Module:
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onGetOrderItemDisplayDetails', $this, 'get_order_item_details');
}
public function get_order_item_details($item, $as_plain_text)
{
if ($item->x_subscription_start_date && $item->x_subscription_end_date)
return 'Subscription: '.
$item->x_subscription_start_date->format('%x').' - '.$item->x_subscription_end_date->format('%x');
return 'Subscription start date is undefined until the order is paid.';
}
Next: shop:onPreProcessProductCustomData event
Previous: shop:onGetOrderItemFieldOptions event
Return to Handling LemonStand events

