Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Main Page to show specific category


Guest

Recommended Posts

Posted

Hello,

 

I can't seem to find an easy way to have the home page (index.php) display a centain category rather than 'featured products'.

 

Hope this makes sense,

 

Jrock

Posted

THanks man,

 

Looks like that should do it. I was hoping for an easier option though. Any other thoughts?

Posted
Took me about two minutes... how much easier can it be?

 

 

I knew there had to be an easier way. I tried the link you showed me, but I just couldn't get it to work right. After some snooping around and a little trial and error this is what I found:

 

In catalog/includes/application_top.php around line 448 there is an area of code that looks like this:

 

// calculate category path
 if (isset($HTTP_GET_VARS['cPath'])) {
$cPath = $HTTP_GET_VARS['cPath'];
 } elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {
$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);
 } else {
$cPath = '';
 }

 

In the last line I put the cpath for the category I wanted to use. '13' in my case.

 

Before:

 

  } else {
$cPath = '';

 

After:

  } else {
$cPath = '13';

 

 

I'm not sure what side effects this will have on my site. But everything seems to be running smooth. I hope this helps someone else. I couldn't seem to find ANYTHING online about this.

 

-Jrock

Posted

 

This contribution works, if you show category id, which doesn't have any subcategories.

 

If you have category with subcategories, the page will be blank.

 

Category -> products - this works

 

Category -> subcategory -> products - this doesn't work - here you must enter the ID of subcategory if you wish to display products on main page.

Archived

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

×
×
  • Create New...