Results 1 to 6 of 6

combine the info box to categories box

This is a discussion on combine the info box to categories box within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; hello, Need to know if it is possible to combine the links in the information box to the categories box. ...

      
  1. #1
    Active Member
    Join Date
    May 2004
    Location
    worcester ma
    Posts
    162
    Rep Power
    0


    Default combine the info box to categories box

    hello,

    Need to know if it is possible to combine the links in the information box to the categories box.

    I would like to have just one nave bar with all my site links in it.

    You can see my modded categories box at www.fridgemags.com for a better idea.

    The links at the bottom left I would like to put up into the categories box.

    Thanx for any info

  2. #2
    Member
    Join Date
    Nov 2002
    Location
    Pennsylvania
    Posts
    93
    Rep Power
    0


    Default

    Yes,

    open categories.php located in catalog/includes/boxes/

    locate this bit of code, located around line 132

    Code:
      $info_box_contents[] = array('text' => $categories_string);
    change the code to this:
    Code:
      $info_box_contents[] = array('text' => $categories_string .
                                             '<br><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                             '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                                             '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                                             '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');
    dont forget to comment out information.php located in column_left.php in the catalog/includes/ directory
    There\'s something about fireman, day and night they are always fireman!

  3. #3
    Active Member
    Join Date
    May 2004
    Location
    worcester ma
    Posts
    162
    Rep Power
    0


    Default

    thanx, worked like a charm.

    one more question now.

    is there a way to get the links to look the same as the rest of them?

    they dont have the line between them and the bullet infront of them.

    my code in my categries box is as follows.

    Code:
    <?php
    /*
      $Id: categories.php,v 1.23 2002/11/12 14:09:30 dgw_ Exp $
    
      osCommerce, Open Source E-Commerce Solutions
      http://www.oscommerce.com
    
      Copyright (c) 2002 osCommerce
    
      Released under the GNU General Public License
    */
    
      function tep_show_category($counter) {
        global $foo, $categories_string, $id, $aa;
    
        for ($a=0; $a<$foo[$counter]['level']; $a++) {
          if ($a == $foo[$counter]['level']-1)
    	  	{
    		$categories_string .= "<font color='#ff0000'>   </font>";
         	} else
    	  		{
    	  		$categories_string .= "<font color='#ff0000'>    </font>";
         		}
    
    		}
        if ($foo[$counter]['level'] == 0)
    	{
    		if ($aa == 1)
    		{
    		$categories_string .= "<hr>";
    	    }
    		else
    		{$aa=1;}
    
    	}
    
    
    
        $categories_string .= '<nobr><a nowrap href="';
    
        if ($foo[$counter]['parent'] == 0) {
          $cPath_new = 'cPath=' . $counter;
        } else {
          $cPath_new = 'cPath=' . $foo[$counter]['path'];
        }
    
        $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new);
        $categories_string .= '">' . tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif', '') . ' ';;
    
        if ( ($id) && (in_array($counter, $id)) ) {
          $categories_string .= "<b><font color='#ff0000'>";
        }
    
    // display category name
        $categories_string .= $foo[$counter]['name'];
    
        if ( ($id) && (in_array($counter, $id)) ) {
          $categories_string .= '</font></b>';
        }
    
       // if (tep_has_category_subcategories($counter)) {
       //   $categories_string .= '->';
       // }
    
        $categories_string .= '</nobr></a>';
    
       // if (SHOW_COUNTS == 'true') {
       //   $products_in_category = tep_count_products_in_category($counter);
       //   if ($products_in_category > 0) {
       //     $categories_string .= ' (' . $products_in_category . ')';
       //   }    }
    
        $categories_string .= '<br>';
    
        if ($foo[$counter]['next_id']) {
          tep_show_category($foo[$counter]['next_id']);
        }
      }
    ?>
    <!-- categories //-->
              <tr>
                <td>
    <?php
      $aa = 0;
      $info_box_contents = array();
      $info_box_contents[] = array('align' => 'left',
                                   'text'  => BOX_HEADING_CATEGORIES
                                  );
      new InfoBoxHeading($info_box_contents, true, false);
    
      $categories_string = '';
    
    // add links to products with no category
      $product_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = 0 and p.products_id = pd.products_id and pd.language_id ='"  . (int)$languages_id . "' order by pd.products_name " );
      while ($no_category = tep_db_fetch_array($product_query))  {
            $no_cat_product_id = $no_category['products_id'];
            $no_cat_products_name = $no_category['products_name'];
    $myref = "<a href=" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $no_cat_product_id) . '>' . $no_cat_products_name . '</a><br><br>';
    $categories_string .= $myref;
    }
      // end links to products with no category
    
      $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
      while ($categories = tep_db_fetch_array($categories_query))  {
        $foo[$categories['categories_id']] = array(
                                            'name' => $categories['categories_name'],
                                            'parent' => $categories['parent_id'],
                                            'level' => 0,
                                            'path' => $categories['categories_id'],
                                            'next_id' => false
                                           );
    
        if (isset($prev_id)) {
          $foo[$prev_id]['next_id'] = $categories['categories_id'];
        }
    
        $prev_id = $categories['categories_id'];
    
        if (!isset($first_element)) {
          $first_element = $categories['categories_id'];
        }
      }
    
      //------------------------
      if ($cPath) {
        $new_path = '';
        $id = split('_', $cPath);
        reset($id);
        while (list($key, $value) = each($id)) {
          unset($prev_id);
          unset($first_id);
          $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");
          $category_check = tep_db_num_rows($categories_query);
          if ($category_check > 0) {
            $new_path .= $value;
            while ($row = tep_db_fetch_array($categories_query)) {
              $foo[$row['categories_id']] = array(
                                                  'name' => $row['categories_name'],
                                                  'parent' => $row['parent_id'],
                                                  'level' => $key+1,
                                                  'path' => $new_path . '_' . $row['categories_id'],
                                                  'next_id' => false
                                                 );
    
              if (isset($prev_id)) {
                $foo[$prev_id]['next_id'] = $row['categories_id'];
              }
    
              $prev_id = $row['categories_id'];
    
              if (!isset($first_id)) {
                $first_id = $row['categories_id'];
              }
    
              $last_id = $row['categories_id'];
            }
            $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
            $foo[$value]['next_id'] = $first_id;
            $new_path .= '_';
          } else {
            break;
          }
        }
      }
      tep_show_category($first_element);
    
      $info_box_contents = array();
      $info_box_contents[] = array('align' => 'left',
                                   'text' => $categories_string . 
                                             '<br><a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' . 
                                             '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' . 
                                             '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' . 
                                             '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');
    
    // WebMakers.com Added: All products or All Products Multiple Purchase
    //  new infoBox($info_box_contents);
    
    // WebMakers.com Added: Show All Products Listing
    if (SHOW_ALL_PRODUCTS_BOX=='1') {
      $info_box_contents[] = array('align' => 'center" valign="top',
                                   'text'  => '<hr><a href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a>');
    }
    
    // WebMakers.com Added: Show multiple product listing add for all products
    if (SHOW_PRODUCT_LISTINGS_MULTI_ADD_BOX=='1') {
    // All Products Multiple Purchase
    
      $info_box_contents[] = array('align' => 'center" valign="top',
                                   'text'  => '<hr><a href="' . tep_href_link(FILENAME_PRODUCTS_ALL, '', 'NONSSL') . '">' . BOX_INFORMATION_PRODUCT_ALL . '</a>');
    }
    
      new InfoBox($info_box_contents);
    
    ?>
    </td>
    </tr>
    <!-- categories_eof //-->
    thanx for the help.

  4. #4
    Active Member
    Join Date
    May 2004
    Location
    worcester ma
    Posts
    162
    Rep Power
    0


    Default

    I had a brain fart. The lines are just <hr> horizontal rules, Normal html.

    But what is the code to dynamically call the image so i can add the bullet in front? newbie with php

    or should i just use the hard code html in front of each link?

  5. #5
    Member
    Join Date
    Nov 2002
    Location
    Pennsylvania
    Posts
    93
    Rep Power
    0


    Default

    It is just html coding
    add this
    Code:
    <img src="http://fridgemags.com/images/checkout_bullet.gif" border="0">
    in front of
    Code:
    <a href="' . tep_href_link(
    for each of the new lines that you just added

    see if that works
    There\'s something about fireman, day and night they are always fireman!

  6. #6
    Active Member
    Join Date
    May 2004
    Location
    worcester ma
    Posts
    162
    Rep Power
    0


    Default

    yep that worked,

    I really need to pick up a book on php. I kept trying to insert the code you gave me but was inserting in the wrong place and the links where not showing up.

    Thanx bunches for the help.

    Sure this thread will help others out also.

Similar Threads

  1. Want to show categories AND sub categories in index.php!!
    By calle in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 10-27-2004, 12:51 PM
  2. CATEGORIES BOX does not display categories list
    By glk in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 03-05-2004, 11:09 AM
  3. help! manufacturers more info pop-up help!
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 02-16-2004, 04:32 PM
  4. How do I add a new link to an info box?
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 3
    Last Post: 09-11-2003, 02:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •