Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Mooligan

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!

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...