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