
Zen Cart Switch Skin
A Zen Cart™ mod which allows you to dynamically switch from one template to another.Donate: This is free software. Show your appreciation by supporting my efforts.

Relevance: Zen Cart™ 1.5.1 and above
Current Version: 1.3 (version history)
Support Thread: Skin Switch Support Thread
Cost: Free, but donation appreciated
Installed Cost: $200.00 Buy Professional Installation by That Software Guy
Installation Difficulty: Moderate
Installation Instructions: click here
Location: Zen Cart Plugins, under Template Alterations
Download: Switch Skin in Zen Cart Plugins
FAQ: click here
The desktop link to switch skins is here:

The mobile link to switch skins is here:

Overview:
If you want to try a new template or provide your customers with multiple templates, this module will help you do that.Installation Instructions:
- Back up everything! Try this in a test environment prior to installing it on a live shop.
- Unzip the file you have received.
- Upload the files in the includes directory to your cart.
- Consider how you would like to do skin-switching. The example1 directory shows how to do it through a link. The example2 directory shows an example of how to do it automatically. (Be sure to rename "custom" to the name of your actual template.) Note: If you are using Zen Cart 1.5.5 or higher, your template name will be "responsive_classic" if you have not changed it.
- Edit
includes/init_includes/overrides/init_templates.php
and right before the line that saysif (isset($_GET['skin'])) {
addset_template();
so now you have/* See if there is an override */ set_template(); if (isset($_GET['skin'])) {
-
Modify the
use_nondefault_template()
function to check the parameter you want to check. The example contains a trivial check for day of the week. You may wish to check- whether or not the visitor is coming from a mobile device (Note: you will need a mobile checking function, such as the mobile detect library)
- the visitor's country of origin (Note: you will need an IP address to Country mapping function, such as this one)
- set the non-default template name in the set_template() function. (I have used
responsive_sheffield_blue
as an example.)
Major Versions
- 1.3 02/08/2023 - Update for Zen Cart 1.5.8
- 1.2a 10/22/2016 - Addition of third example by
@ideasgirl
- 1.2 09/18/2016 - Update for Zen Cart 1.5.5a
- 1.1a 10/24/2015 - Documentation updates
- 1.1 09/06/2015 - Addition of second example
- 1.0 07/05/2015 - First Release
FAQ
Q: Is the name of this mod Switch Skin or Skin Switch?A: Yes. This is in the spirit of switching.