Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Two shops in one?


Guest

Recommended Posts

Hi folks,

 

I'm trying to figure out a way to have two completely different color schemes in the same install. Probably the easiest way I am thinking is to have two main categories, and everything else a sub-category / sub-product of the two main ones. Then have one color scheme for each category tree.

 

What I'm trying to accomplish is have two distinct feels to the store...one for the higher end custom work, and another for the more commonly available, always in stock stuff. I'd like to use the same checkout and existing infrastructure though.

 

Would this be a difficult hack? Been searching the forum and I'm coming up with nothing.

 

TYIA for your help!

Link to comment
Share on other sites

I've done something similar for another project I'm working on.

 

i have 2 categories at the moment: food and wine

 

the food cat has a blue theme to it and the wines is red.

 

i decided that the easiest way would be to check the url for the names food or wine (i'm using seo url's)

 

so the first step was to put this in the includes/application_top.php file:

 

$myurl = ltrim($_SERVER['REQUEST_URI'], '/');

 

so i could then use some regex in my files like this for example in index.php in the <head> section to change the css based on the category we're in.

 

$regexp = "/food/";
$regexp2 = "/wines/";

if (preg_match($regexp, $myurl)) {
<style type="text/css">
style 1 info here...
</style>
}else if (preg_match($regexp2, $myurl)){
<style type="text/css">
style 2 info here...
</style>
}else{
<style type="text/css">
style 3 info here...
</style>
}

 

 

if anyone has a better way to do this let me know. :)

Designrfix.com | Graphic Design Inspiration & Web Design Resources - @designrfix
Link to comment
Share on other sites

I've done something similar for another project I'm working on.

 

Wow, that's definitely thinking out of the box...I like it. Did it turn out to be functional on the site you're building? I don't have great code skills, so that code is a bit above my head, but a good buddy knows more about php and should be able to help me out with it. I tend to break stuff if I try ninja stuff like that ;)

Link to comment
Share on other sites

yep, turned out pretty good so far. The only thing left for me is to figure out how to do the same for the product pages. i guess i need some extra sql queries in there to find out where the product came from (food or wines category) or else just use a default look for all products either way is good.

Designrfix.com | Graphic Design Inspiration & Web Design Resources - @designrfix
Link to comment
Share on other sites

yep, turned out pretty good so far. The only thing left for me is to figure out how to do the same for the product pages. i guess i need some extra sql queries in there to find out where the product came from (food or wines category) or else just use a default look for all products either way is good.

 

Oh...hmm, that would be a problem for me since I need the product pages to have color schemes which conform to the master catagory.

Link to comment
Share on other sites

  • 2 weeks later...

OK, a buddy of mine helped figure this out. Put this in the index and product_info:

 

<?php 
if(isset($cPath) && (strncmp($cPath_array[0], "133", 3) == 0))	 {  ?>
 <link rel="stylesheet" type="text/css" href="stylesheet_dev2.css">
<?php	  } else {
?>	  <link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php }>

 

Just replace the "133" with whatever the cpath is for the category. Then replace the '<link_rel="stylesheet" line with that chunk of code. Finally, copy your current stylesheet and make it "stylesheet_dev2.css" in the root cat dir. All sub cats and products will ref the new css.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...