I am working on a module which replaces the invoice templates. Following the guide
here, I created the following template file:
Code:
skins/common/modules/LBS/OrderNumber/order/invoice/parts/title.twig
Since it is a part of the invoice.head viewList, I added the following to the end of my module's Main.php.
Code:
protected static function moveTemplatesInLists()
{
$templates = [
'order/invoice/parts/title.twig' => [
static::TO_DELETE => [
['invoice.head', \XLite\Model\ViewList::INTERFACE_CUSTOMER],
],
],
];
return $templates;
}
This results in both the original title.twig and my title.twig being rendered side-by-side on the invoice header. Since the original title.twig is located under the common skins, that INTERFACE_CUSTOMER is not correct. I looked in XLite\Model\ViewList.php for a possible INTERFACE_COMMON definition. Since there was none, I saw that INTERFACE_CUSTOMER returns the string 'customer', and INTERFACE_ADMIN returns the string 'admin', so I tried changing the line,
Code:
['invoice.head', \XLite\Model\ViewList::INTERFACE_CUSTOMER]
to,
Code:
['invoice.head', 'common']
which produced the same result.
What is the proper way to replace a template found within skins/common? Or is it it that the viewList 'invoice.head' is part of another viewList? Do I need to specify all the parents and grandparents of the viewList? I shall try something along those lines to see if it works in the meantime while waiting for some much appreciated feedback.