LiteCommerce module: custom stand alone theme
This example module is for the stand-alone version of LiteCommerce only. When using LC in a connection with Drupal you can do most of the below things withing the Drupal back-end, or by creating a Drupal subtheme.
This example module shows you how how to alter the default LiteCommerce theme by creating a theme module.
-
Create a blank LiteCommerce module beneath the directory where your shop is installed. For this example we assume that the module resides in the "classes/XLite/Module/Custom/Theme/" directory.
-
Now lets change the width, the height and the number of subcategory icons per row. To do this create the "classes/XLite/Module/Custom/Theme/View/Subcategories.php" file. Now edit it as follows: <?php
namespace XLite\Module\Custom\Theme\View; class Subcategories extends \XLite\View\Subcategories implements \XLite\Base\IDecorator { /** * Return the maximal icon width * * @return integer */ protected function getIconWidth() { return <YOUR WIDTH>; } /** * Return the maximal icon height * * @return integer */ protected function getIconHeight() { return <YOUR HEIGHT>; } /** * Return the number of columns * * @return integer */ protected function getColumnsCount() { return <YOUR NUMBER OF COLUMNS>; } }
-
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 "Manage add-ons" page (the shop back-end -> "Add-ons" tab -> "Manage add-ons" page). Enable the module on this page (this will re-build the cache once again).