Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change products displayed order to price sorted rather than alpha 2.3.3


themuir

Recommended Posts

Hi there,

 

I have been reading lots of posts today but I can't find a solution.

 

I need to change the way the the products are displaying on a website I'm working on. I need to change the order from alphabetical display to price ascending.

 

I have read you need to change index.php but the index I have does not have the required code to change.

 

Is there any other way of doing this? 

 

This is the index.php file I have (in catalogue/index.php)

 

Hopefully someone can help me :-)

 

<?php
/*
  $Id$
 
  osCommerce, Open Source E-Commerce Solutions
 
  Copyright © 2010 osCommerce
 
  Released under the GNU General Public License
*/
 
  require('includes/application_top.php');
 
// the following cPath references come from application_top.php
  $category_depth = 'top';
  if (isset($cPath) && tep_not_null($cPath)) {
    $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
    $categories_products = tep_db_fetch_array($categories_products_query);
    if ($categories_products['total'] > 0) {
      $category_depth = 'products'; // display products
    } else {
      $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
      $category_parent = tep_db_fetch_array($category_parent_query);
      if ($category_parent['total'] > 0) {
        $category_depth = 'nested'; // navigate through the categories
      } else {
        $category_depth = 'products'; // category has no products, but display the 'no products' message
      }
    }
  }
 
  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>
 
<?php
  if ($category_depth == 'nested') {
  $current_page = FILENAME_CATEGORIES_NESTED;
  require(DIR_WS_INCLUDES . 'template_top.php');
  
  include(FILENAME_CATEGORIES_NESTED); 
?>
 
<?php
  } elseif ($category_depth == 'products' || (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id']))) {
  $current_page = FILENAME_CATEGORIES_LISTING;
  require(DIR_WS_INCLUDES . 'template_top.php');
 
  include(FILENAME_CATEGORIES_LISTING);
?>  
 
<?php
  } else { // default page
  $current_page = FILENAME_DEFAULT;
  require(DIR_WS_INCLUDES . 'template_top.php');
 
?>
<?php  if ( (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true') || (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true')) { ?>
<?php ?>
<?php } ?>
 
<div class="none">
<?php echo tep_draw_title_top();?>
<h1><?php echo HEADING_TITLE; ?></h1>
<?php echo tep_draw_title_bottom();?><br />
</div>
 
 
<?php
if (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true') {
echo tep_draw_content_top();
include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
echo tep_draw_content_bottom();
}
if (FEATURED_MODUL_DISPLAY_FIRST_PAGE == 'true') {
echo tep_draw_content_top();
include(DIR_WS_MODULES . FILENAME_FEATURED); 
echo tep_draw_content_bottom();
}
    include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>
<?php  if ( (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true') || (NEW_PRODUCTS_MODULE_DISPLAY_FIRST_PAGE == 'true')) { ?>
<?php ?>
<?php } ?>
 
 
<?php
  }
 
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
 
Link to comment
Share on other sites

Hi,

 

Sorry, not a real answer to your question, but when customers are on your website, there is a tab at the top, so they can sort by product name or price.  If they click the price it re-sorts. 

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...