Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Where can I set a new variable?

Where can I set a new variable?

Locked

Views: 1,978

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
10 Jun 2007, 10:08 AM
#1
dan_ballance avatar

dan_ballance

New Zenner

Join Date:
Feb 2007
Posts:
3
Plugin Contributions:
0

Where can I set a new variable?

Hi there,

My clients have asked me to deliver them 'two shops in one'. What they mean by this, is there should be two site designs reflecting the two types of products they sell. I am thinking of using different colour schemes and making the one design flow from the left, the other from the right. This way there is a unified look to the whole shop, but it will be clear which section or 'shop' they are in at all times.

So how to do this in zencart?

I am thinking of having two links in the masthead (shopone | shoptwo ) and when they are clicked a variable is set. Then, when the main page loads, i replace the table on the main page with an if and include statement, ie

if $shop is set to 1
then include file one
else
include file two

This way the display of the main content of the page is altered according to their selection.

So my question is:

How and where do i set a variable in zencart so that it will persist throughout the site, whatever page the user browses to?

many thanks if anyone could help me with this,

dan :-)

10 Jun 2007, 10:30 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Where can I set a new variable?

PHP session variables persist until the session is ended or they are explicitly unset.

Have you read the text files in your css directory? They explain how to create different styling for each product or section of your site.

You can also force different templates based on, for example session variables, but also GET values (useful if you're changing things using links) by amending the init_templates.php file.