Jump to content
Sign in to follow this  
Mooligan

Can someone help me with the 'Main Categories' Contribution?

Recommended Posts

This contribution http://www.oscommerce.com/community/contri...ions,236/page,3

 

It hasn't been updated in awhile (November 2002) and it looks like the default.php has changed since he wrote the documentation on how to install it. The problem I have is with step 3:

3. Make the following addition to /catalog/default.php

 

Find the following:

 

<tr>

<td class="main"><br><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAINPAGE); ?></td>

</tr>

 

And add this AFTER:

 

<tr>

<td><?php include(DIR_WS_MODULES . MAIN_CATEGORIES); ?></td>

</tr>

 

The section that it tells me to look for in default.php doesn't seem to exist anymore?

 

Is there somewhere else I should put that little tidbit of code? Or maybe there is another contribution that serves the same purpose, rather than the front page having the New Product Box, have a browse by category box. I looked around and didn't see anything..

 

Thanks!

Share this post


Link to post
Share on other sites

Look for this:

<tr>

           <td class="main"><?php echo TEXT_MAIN; ?></td>

   </tr>

 

and put this in afterwards:

	<!-- BOF: Main Categories Edit //-->

   <tr>

           <td><?php include(DIR_WS_MODULES . MAIN_CATEGORIES); ?></td>

         </tr>

   <!-- EOF: //-->

 

That works for me at least except I get this problem right above the main Categories box:

Warning: Invalid argument supplied for foreach() in c:program filesapache groupapachehtdocscatalog06-15-03includesmodulesmain_categories.php on line 52

 

This is the code on line 52 onwards:

// Traverse category tree

   foreach ($foo as $key => $value) {

     if ($foo[$key]['parent'] == $cid) {

//        print "$key, $level, $cid, $cpath<br>";

       preorder($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : ''));



     }

   }

 

Does anyone know how to fix this?

 

peace

sean

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×