Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Making default.php appear at deeper cPath depths


Quasi

Recommended Posts

Hi,

 

In vanilla OSC the default frontpage ("Would you like to log yourself in? Or would you prefer..etc etc") appears when you are not in any sub categories, ie, here: www.something.xyz/default.php

 

I also want it to appear when you are one level down in the sub cats, ie www.something.xyz/default.php?cPath=12

 

When you go down another layer then it should resort to normal OSC behaviour.

 

Im sure its something to do with $category_depth in default.php but I havent figured out how yet, I'd be grateful if anyone has any ideas.

 

As you may have guessed by the "default.php" Im using 2.2MS1, but Im sure MS2 isnt that different in this respect.

 

Thanks

Does this smell like chloroform to you?

Link to comment
Share on other sites

Why do I always think of solutions *after* I've posted on the board.

 

OK, this seems to work (remember, 2.2MS1)

 

default.php (index.php), line 18

 

was:

 

if (isset($cPath) && tep_not_null($cPath)) {

 

So, if the cPath is set and its not null then assume you're in a subcat so show products, etc...

 

change to:

 

if (isset($cPath) && tep_not_null($cPath) && strstr($cPath, "_")) {

 

Now it checks for the same things, but also looks for an underscore in the cPath. If there is an underscore then we must be 2 or more subcats down so show product listings, other wise if we're in the homepage or very top subcat show the default homepage as normal.

 

Or am I doing something dangerous here, any comments please. :)

Does this smell like chloroform to you?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...