Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Selectable stylesheets...


SafeMrRomeo

Recommended Posts

Posted

I would like to create a selectable sylesheet for my oscommerce store. Im not sure if its possible with oscommerce.

 

I have no problem creating the stylesheets but i was wondering how would i go about getting the oscommerce store to reload the page with the selected stylesheet and remembering the customers choice?

 

Ben

Posted
I would like to create a selectable sylesheet for my oscommerce store. Im not sure if its possible with oscommerce.

 

I have no problem creating the stylesheets but i was wondering how would i go about getting the oscommerce store to reload the page with the selected stylesheet and remembering the customers choice?

 

Ben

 

sure it's possible. in fact, i've built sites with a <link rel="stylesheet" type="text/css" href="stylesheet.php"> and built the stylesheet.php to generate all the css from information in a database. as far as the browser is concerned, it's just a file to download. it doesn't know if it's coming from a static file or if the data is being generated by php on the fly. fortunately, browsers are apathetic that way.

 

so to accomplish this, i'd do something like the following:

 

1. add a new column to the customers table to hold the stylesheet selection. do not specify 'not null' on this column and do specify a default value. verify all records have the default value.

 

2. modify the account_edit.php to allow editing of the stylesheet selection.

 

3. modify all of your .php files in the catalog/ directory, removing the <link rel="stylesheet"...> tag and replacing with <?php include('stylesheet.php'); ?>

 

4. create a stylesheet.php that will output the appropriate <link rel="stylesheet"...> tag based on whether or not the user is logged in...otherwise use a default.

 

5. create the appropriate stylesheet file names that are referenced in the stylesheet.php based on the style selected by the user.

 

the only thing this won't allow you to do is select different images for the buttons. that could still be done but it'd be more involved and would require changes to some of the functions that output the image links. just a little tedious...

 

there may be more details to sort out, but i think those are the major points.

 

i hope this helps.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...