View Single Post
  #3  
Old 07-12-2020, 11:07 AM
  The Knotty Celt's Avatar 
The Knotty Celt The Knotty Celt is offline
 

Advanced Member
  
Join Date: Jan 2020
Posts: 32
 

Default Re: Replacing templates from common skins

Quote:
Originally Posted by Ed B.
This may be a "dirty" work around, but should work: instead of bothering with viewlist, just override the viewer. So override XLite/View/Invoice.php to change
getDefaultTemplate() or XLite/View/InvoicePage.php to modify getDir(), getBody() or getHead(), whichever is appropriate.




I have since tried that, by implementing IDecorator on both Invoice and InvoicePage View classes, and updating the getDir(), getBody() and getHead(), among other functions referring to various template files. Now, everything is duplicated. I also copied the template files into the appropriate modules' locations. The result is that both the original templates and module templates are appearing side-by-side. It's as though both sets of Invoice and InvoicePage classes are being loaded, rather than the module replacing the original view.
__________________
X-Cart version 5.4.1.46
PHP version 7.4.33
MySQL version 15.1
Apache version 2.4.56
cURL version 7.74.0
Reply With Quote