Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

help with catalog


Guest

Recommended Posts

Posted

I am new to this and I am trying to get my site to when you click on a category that has subcategories it shows random products of all the subcategories and not the subcategories right now when you click on a category it will show the subcategories on the left side and in the middle how would i stop it from showing in the middle

 

 

 

if anyone could tell me how to get my site to fill the page its only in the middle of the page i would like it to fill the page

Posted

I believe that the display is controlled in index.php, the changes that need to be made depends on what you want to display.

 

The documentation with rca2 say this is how to set the width.

 

Setting the Table Width
You can change the width of your shopping cart to be centered on the page at a width of
770 pixels with no cellpadding or cellspacing.
In the catalog/index.php file change this info:
<!-- body //-->
< table border="0" width="100%" cellspacing="3" cellpadding="3">
< tr>
< td width="<?php echo BOX_WIDTH; ?>"><table border="0" width="<?php echo
BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
< !-- left_navigation //-->
To this info:
<!-- body //-->
< table border="0" width="770" cellspacing="0" cellpadding="0" align="center">
< tr>
< td width="<?php echo BOX_WIDTH; ?>"><table border="0" width="<?php echo
BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
< !-- left_navigation //-->
All of the files in the catalog folder plus the catalog/includes/header.php and
catalog/includes/footer.php files will need to be changed. A quick find and replace in
your editor will replace all the pages that have the same code as above in the catalog
folder. The header.php and footer.php files have a little different code and would need to
be manually changed.

 

Loks like you will just need to reverse this.

 

HTH

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted

I want to display random products from all the subcategories instead of the subcategories themself

Posted

I am new to this and I am trying to get my site to when you click on a category that has subcategories it shows random products of all the subcategories and not the subcategories right now when you click on a category it will show the subcategories on the left side and in the middle how would i stop it from showing in the middle

 

 

 

if anyone could tell me how to get my site to fill the page its only in the middle of the page i would like it to fill the page

So if I'm getting this right, you click on any category and you want all the categories in the middle to go away? If so, in catalog/index.php:

 

FIND:

 

<?php
   if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
     $category_links = array_reverse($cPath_array);
     for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
       $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
       $categories = tep_db_fetch_array($categories_query);
       if ($categories['total'] < 1) {
         // do nothing, go through the loop
       } else {
         $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
         break; // we've found the deepest category the customer is in
       }
     }
   } else {
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
   }

   $number_of_categories = tep_db_num_rows($categories_query);

   $rows = 0;
   while ($categories = tep_db_fetch_array($categories_query)) {
     $rows++;
     $cPath_new = tep_get_path($categories['categories_id']);
     $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
     echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
     if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
       echo '              </tr>' . "\n";
       echo '              <tr>' . "\n";
     }
   }

 

REPLACE WITH:

 

<?php
/*    if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
     $category_links = array_reverse($cPath_array);
     for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
       $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
       $categories = tep_db_fetch_array($categories_query);
       if ($categories['total'] < 1) {
         // do nothing, go through the loop
       } else {
         $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
         break; // we've found the deepest category the customer is in
       }
     }
   } else {
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
   }

   $number_of_categories = tep_db_num_rows($categories_query);

   $rows = 0;
   while ($categories = tep_db_fetch_array($categories_query)) {
     $rows++;
     $cPath_new = tep_get_path($categories['categories_id']);
     $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
     echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
     if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
       echo '              </tr>' . "\n";
       echo '              <tr>' . "\n";
     }
   }
*/

Posted

a.forever I tried to do that but i got an error

 

i tried that addon but still nothing

 

here is my site www.techsonhandstore.com

 

now if you click on a category that has subcategories you will see what i am talking about and that is what i am trying to take out and just put random products in

Archived

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

×
×
  • Create New...