View Single Post
  #1  
Old 09-15-2012, 08:59 AM
  rubyaryat's Avatar 
rubyaryat rubyaryat is offline
 

eXpert
  
Join Date: Feb 2003
Location: Canada
Posts: 289
 

Default Simple Theme Switching

This may have been posted already, but to implement a simple theme switching, so that you might show a client a new theme on a store, add the following to init.php (around line 550):


PHP Code:
include_once($xcart_dir '/include/data_cache.php');

//Rubymods
//home.php?alt_skin=20_3-columns
if ($_GET['alt_skin'])
  
$config['alt_skin'] = $_GET['alt_skin'];

/**
 * Initialize alt_skin feature
 */
list($altSkinsInfo$alt_skin_info$alt_skin_dir) = func_get_alt_skin(); 

This will allow you to switch themes by specifying an 'alt_skin' GET parameter in your URL and giving it the value of the theme (get the theme values from your admin at: admin/configuration.php?option=Appearance if you look at the select values for themes).

e.g. home.php?alt_skin=20_3-columns

Hope this helps someone.
Rubyaryat
__________________
Rubymods.com - Your X-Cart services partner for over 9 years.
Modules offered: FedEx labels, Live currency rates, GeoIP, Order Audit, Multiple e-goods.
X-Cart Store Hosting, project management and affiliates program available.
4.2.3 gold [Unix]
Reply With Quote