Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Open home page to category of your choice


germ

Recommended Posts

Posted

MAKE A BACKUP BEFORE MAKING ANY EDITS.

 

At the top of your /catalog/index.php find this code:

 

// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {

Change it to something like this:

 

// the following cPath references come from application_top.php
 $category_depth = 'top';

//
// beginning of added code:
//

 if ( ! isset($cPath) || ($cPath=='') ) {
$cPath_array[0] = 21;
$cPath = 21;
$current_category_id = 21;
 }

//
// end of added code
//

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

I used the number 21 as an example.

 

You'd need to replace that number with the number of the category it is that you wish to open.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Here is a link to a thread where someone who tried this had a little problem with it when selecting a particular manufacturer:

 

Click Me

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

  • 1 year later...
Posted

<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--><b>MAKE A BACKUP BEFORE MAKING ANY EDITS.</b><!--colorc--></span><!--/colorc-->

 

At the top of your <b>/catalog/<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->index.php<!--colorc--></span><!--/colorc--></b> find this code:

 

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// the following cPath references come from application_top.php

$category_depth = 'top';

if (isset($cPath) && tep_not_null($cPath)) {<!--c2--></div><!--ec2-->

Change it to something like this:

 

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->// the following cPath references come from application_top.php

$category_depth = 'top';

 

//

// beginning of added code:

//

 

if ( ! isset($cPath) || ($cPath=='') ) {

$cPath_array[0] = 21;

$cPath = 21;

$current_category_id = 21;

}

 

//

// end of added code

//

 

if (isset($cPath) && tep_not_null($cPath)) {<!--c2--></div><!--ec2-->

I used the number 21 as an example.

 

You'd need to replace that number with the number of the category it is that you wish to open.

 

This is exactly what I want but why does it remove my TEXT_MAIN?

  • 3 weeks later...
Posted

This is exactly what I want but why does it remove my TEXT_MAIN?

Because you end up in a different part of the code where TEXT_MAIN doesn't get displayed.

 

Sorry I didn't reply sooner.

 

You only get email reply notifications to a thread for thirty days.

 

I hadn't posted in this in over a year.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Germ do you know how to re-name the index.php file to let say for example shop.php without messing up the other functions on index.php.

Posted

Germ do you know how to re-name the index.php file to let say for example shop.php without messing up the other functions on index.php.

I think all you would need to do is change this in /includes/filenames.php

 

  define('FILENAME_DEFAULT', 'index.php');

To match the new file name

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

thanks Germs I will give this a try and let you know much appreciated for the help

You do realize that if you rename the existing index file you'll need to replace it with another "placeholder" (index.php, index.htm, or index.html)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

nope seem to have got an error saying the following;

Warning: require(includes/languages/english/shop.php) [function.require]: failed to open stream: No such file or directory in /home/fhlinux190/i/inbreathe.co.uk/user/htdocs/catalog/index.php on line 33

 

Warning: require(includes/languages/english/shop.php) [function.require]: failed to open stream: No such file or directory in /home/fhlinux190/i/inbreathe.co.uk/user/htdocs/catalog/index.php on line 33

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages/english/shop.php' (include_path='.:/usr/share/pear/') in /home/fhlinux190/i/inbreathe.co.uk/user/htdocs/catalog/index.php on line 33

 

Any other ideas? please

Posted

nope seem to have got an error saying the following;

 

 

Any other ideas? please

My bad!

 

You have to rename the index.php in /includes/languages/english folder to the same name, too.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

If all you did was rename the files it should work.

 

It acts like the /catalog/shop.php doesn't exist.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

You probably got one of those files in the wrong place. catalog/shop.php and catalog/includes/languages/english/shop.php are not interchangeable.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Posted

I kind of did what you're trying to do (I think).

 

The guy who owns the site I manage didn't want the categories on the "landing page".

 

So I crerated a different index.php as a new landing page.

 

But what I did was create a new entry in filenames.php called FILENAME_CATALOG and changed other places in the code to reference it instead.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Don't get me wrong.

 

I'm not trying to say the way you're going about it is wrong.

 

I'm just saying how I did it at the time.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Well it's time for me to get some shut-eye as well.

 

Let me look over the code and I'll see if I can get something together and post it tomorrow evening,

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

I renamed the index and made an entry in /includes/filenames.php to the new name:

 

  define('FILENAME_CATALOG', 'indexnew.php');

Then I only had to change three other files.

 

/includes/application_top.php

(Two nonconsecutive lines)

 

  $breadcrumb->add(HEADER_TITLE_CATALOG, tep_href_link(FILENAME_CATALOG));

       $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_CATALOG, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));

/includes/modules/categories.php

 

    $categories_string .= tep_href_link(FILENAME_CATALOG, $cPath_new) . '">';

/login.php

 

if(MODULE_PAYMENT_PAYPAL_EC_STATUS == 'True' || MODULE_PAYMENT_PAYPAL_WPP_STATUS == 'True') { tep_redirect(tep_href_link(FILENAME_CATALOG)); } 
else { tep_redirect(tep_href_link(FILENAME_DEFAULT));}

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

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

×
×
  • Create New...