Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Different layout on same site


Tetsuo74

Recommended Posts

Hi everyone.

 

Is it possible to to load different column files on the site by the press of a button?

 

What I want to do is to sell 4 different product groups in my shop. And I want the store to reflect that these product groups are very different. So, I'm making 4 buttons in the header of the page. And when you press the button for manufacturer A, I want to load a different column file (let's say a new file called column_left_A.php) then what you normally do. I'd also like to load a different index file for the center of the shop. Is this possible?

 

My next step will then be to change the colors and boxes for these new columns to reflect which product group the customer is viewing.

 

I will be gratefull for any help!

Link to comment
Share on other sites

If you add a global variable, you can then check it and call the different files. Something like

switch ($product_group) {
case 1: require(DIR_WS_INCLUDES . 'column_left_1.php');  break; 
case 2: require(DIR_WS_INCLUDES . 'column_left_2.php');  break;

I have tested this but I think it should work.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

If you add a global variable, you can then check it and call the different files.  Something like
switch ($product_group) {
case 1: require(DIR_WS_INCLUDES . 'column_left_1.php'); ?break; 
case 2: require(DIR_WS_INCLUDES . 'column_left_2.php'); ?break;

I have tested this but I think it should work.

 

Jack

 

Thank you for your reply Jack.

 

I'm not very good at php, but I'll search for some info on how to do this. So far I have only added contrubutions and done small changes. But hey, I've bought the PHP & MySQL for dummies and am willing to learn. Adding a global variable can't be that hard, can it? :sweating:

Link to comment
Share on other sites

Not hard but if you are new to it, you may get confused. Go slow, do one thing at a time and keep backups. :) Look in login.php. You'll see calls to tep_session_register. Declare your variable there and register it. Use one of the other variables as an example and check how it is called in different parts of the code.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...