shop:onOrderSupportsInvoices event
The shop:onOrderSupportsInvoices event allows to enable the invoice support for a specific order. By default the invoice support is disabled, but some modules, for example Subscriptions Module, require it. When the invoice support is enabled for specific order, the Order Preview form displays the Invoices tab, which contains a list of the order invoices. The event handler function should accept a single parameter - the order object (Shop_Order). The event handler must return TRUE if invoices should be supported for the order.
Event handler example:
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onOrderSupportsInvoices', $this, 'eval_order_supports_invoices');
}
public function eval_order_supports_invoices($order)
{
foreach ($order->items as $item)
{
if ($item->product)
{
if ($item->product->subscription_plan)
return true;
}
}
return false;
}
Next: shop:onBeforeOrderInternalStatusMessageSent
Previous: shop:onInvoiceSystemSupported event
Return to Handling LemonStand events

