Skip to content

LiteCommerce module: custom Terms & Conditions template

beatnbite edited this page Feb 1, 2012 · 1 revision

In the stand-alone "out-of-the-box" version of LiteCommerce you cannot format your Terms & Conditions page with HTML tags. This small tutorial explains how you can do it by creating a custom template file for the page:

  1. Create a blank LiteCommerce module.

  2. Create the "skins/default/en/modules/<your developer ID>/<your module ID>/terms_and_conditions/body.tpl" file and put there your page contents formatted with HTML tags. Then create the "classes/XLite/Module/<your developer ID>/<your module ID>/View/Terms.php" file and edit it as follows:

     <?php
             
     namespace XLite\Module\<your developer ID>\<your module ID>\View;
    
     class Terms extends \XLite\View\Terms implements \XLite\Base\IDecorator
     {
     
         /**
          * Return the path to the directory with the widget template file
          *
          * @return string
          */
         protected function getDir()
         {
             return 'modules/<your developer ID>/<your module ID>/terms_and_conditions';
         }
     
     }        
    
  3. Re-build the LiteCommerce classes cache (the shop back-end -> "Maintenance" tab -> "Re-Build cache" page) to get the new module listed among other modules on the "Add-ons" page. Then go to that page and enable the module (this will re-build the cache once again).

Clone this wiki locally