Theme Switcher (OpenCart Addon)
![]() Click to enlarge |
|
DEMO (top-left sidebox)
Supported OpenCart Versions:
================
v1.3.2, v1.3.3, v1.3.4, v1.4.0, v1.4.4, v1.4.6, v1.4.7, v1.4.8
What does it do:
================
This contrib adds a new sidebox module for template switching. Great for showcasing multiple templates
Main features:
==============
* Completely self-contained using the OpenCart module system making it virtually transparent to upgrades (no core files are overwritten)
How to install it:
==================
1) Unzip and upload the contents to the root directory of your OpenCart installation, preserving directory structure
-- No files are overwritten
2) From the admin menu, go to 'Admin->Users->User Groups'. Edit Top Administrator.
3) Find and check the entries for any unchecked files in both modify and access. save.
4) From the admin menu, go to 'Extensions->Module'.
5) Install the module, and click edit to configure.
6) a. EDIT: system/engine/controller.php
b. FIND:
-----------------------------------
$file = DIR_TEMPLATE . $filename;
-----------------------------------
c. BEFORE, ADD:
-----------------------------------
// Q: Theme Switcher
if (isset($this->request->get['theme']) && $this->request->get['theme'] || isset($this->session->data['theme'])) {
$directories = glob(DIR_APPLICATION . 'view/theme/*', GLOB_ONLYDIR);
$this->session->data['theme'] = (isset($this->request->get['theme']) && $this->request->get['theme']) ? $this->request->get['theme'] : $this->session->data['theme'];
foreach ($directories as $directory) {
if ($this->session->data['theme'] == basename($directory)) {
$tmp = explode('/', $filename);
$tmp[0] = $this->session->data['theme'];
$filename2 = implode('/', $tmp);
$file2 = DIR_TEMPLATE . $filename2;
if (file_exists($file2)) {
$filename = $filename2;
}
break;
}
}
}
//
-----------------------------------
Your Review: Note: HTML is not translated!
Rating: Bad Good
Enter the code in the box below:

Categories
Information
Brands
Featured



Shopping Cart
Specials
Bestsellers





