Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Christian Lescuyer

Archived
  • Posts

    562
  • Joined

  • Last visited

About Christian Lescuyer

  • Birthday November 26

Profile Information

  • Real Name
    Christian Lescuyer
  • Gender
    Male
  • Location
    Paris, France

Christian Lescuyer's Achievements

  1. It's in the configuration table, in a varchar(255), so no, you don't have unlimited options. With a pattern such as 10:9.99 , you'll get a few dozen rates at most. You could set up everything in a .ini file and load it in the shipping module.
  2. Try this: <?php /* $Id: categories.php,v 1.0 2002/04/16 10:30:00 cl__ Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 Go?lette www.goelette.net Christian Lescuyer <[email protected]> History: 1.0 Creation Released under the GNU General Public License */ ?> <!-- categories_module //--> <?php define('SUB_CAT_MAX', 6); // Maximum number of subcategories to display ////////// // Get categories list ////////// // Test for presence of status field for compatibility with older versions $status = tep_db_num_rows(tep_db_query('describe categories status')); $query = "select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id"; if ($status > 0) $query.= " and c.status = '1'"; $query.= " and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name"; $categories_query = tep_db_query($query); // Stuff in an array while ($category = tep_db_fetch_array($categories_query)) { $categories[$category['categories_id']] = array('name' => $category['categories_name'], 'parent' => $category['parent_id']); } // Prepare the box $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_CATEGORIES); new contentBoxHeading($info_box_contents); $info_box_contents = array(); $row = 0; $col = 0; // Fill in the box $cat_number = count($categories); foreach ($categories as $id => $value) { // Display only if top-level category if ($value['parent'] == 0) { $text = '<span class="smallText"><b>'; $text.= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $id) . '">'; $text.= $value['name'] . '</b></a><br>'; $sub_cat_count = 0; // Get sub_categories, limit to SUB_CAT_MAX for ($i = 0; $i < $cat_number && $sub_cat_count < SUB_CAT_MAX; $i++) { if ($categories[$i]['parent'] == $id) { $text .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $id . '_' . $i) . '">'; $text .= $categories[$i]['name']; $text .= '</a>, '; $sub_cat_count++; } } // "more..." $text .= '<b><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $id) . '">more...</b></a>'; $text .= '</span>'; // Output box $info_box_contents[$row][$col] = array('align' => 'left', 'params' => 'width="50%" valign="top"', 'text' => $text); if (++$col > 1) { $col = 0; $row ++; } } } new contentBox($info_box_contents); ?> <!-- categories_module_eof //--> Actually, I've forgotten what it does :lol: Just try it! Save as categories.php in includes/modules. Then call with <?php include(DIR_WS_MODULES . 'categories.php'); ?>
  3. I think there are. The new products module is called in default.php with: <?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?> Add a new module in includes/modules, add its name in application_top.php. The module should contain either plain HTML (if your categories never/rarely change) or an SQL query to get the categories names from the database.
  4. I did not check this contribution. As a rule, patch will work reliably on a specific base. If you apply it to different versions, you might get unexpected results. In that case, apply by hand (I mean with a text editor :) )
×
×
  • Create New...