Zen Cart Logo
Forums / General Questions / Switching templates front end

Switching templates front end

Views: 714

Results 1 to 4 of 4
29 Aug 2014, 8:49 PM
#1
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Switching templates front end

Can someone remind me which file controls the template selected?

I want to override it so that I can use a query string the set a session to switch between the current on and a new one I will be building.

If this has been discussed before and you know where the thread is id be grateful for a link :)

Cheers

Phil

29 Aug 2014, 9:07 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Re: Switching templates front end

/includes/init_includes/init_templates.php

29 Aug 2014, 9:13 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Switching templates front end

philip937:

Can someone remind me which file controls the template selected?

I want to override it so that I can use a query string the set a session to switch between the current on and a new one I will be building.

If this has been discussed before and you know where the thread is id be grateful for a link :)

Cheers

Phil

The template is designated in the database, not a file. However, if a uri type string is desired to change the template, I'm thinking that perhaps something in the index.php file so that a setting is checked but not directly applied to the system. By that I mean you don't want to just grab the information and use it directly, but have some form of cleansing of the input. If there are only two to switch between maybe just having a value of true goes to the one template after also verifying that the value is set, and if the value is set and equal to false goes to the other.

29 Aug 2014, 9:16 PM
#4
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Switching templates front end

Cheers lat9 :)

Do you know if zen cart has any custom ways sessions are set or is it standard php ie:

$_SESSION['template_switch']=1;

Or is there a slightly different way? I assume setting custom sessions is safe as long as they don't conflict with any existing ones?