Community Add-Ons

Add file to this package
Top » Features

Custom sort order field for products in admin/categories.php
for osCommerce Online Merchant v2.2

This modification adds a textbox next to the status radio buttons in categories.php which allows you to enter a default sort order for your products (see screenshot.jpg).

The customer is still able to resort products in the product listing if they want but this mod provides a means of ensuring that your premium products are shown at the top of the listing.

To set the sort order, simply enter the number directly into the textbox.

It is easy to implement with only one column added to the products table and 8 chunks of code to copy/paste.

Also included in the miniimages.txt file is a simple mod (4 copy/pastes) to add a tiny image (your existing image scaled down, see screenshot.jpg) next to each product in categories.php

To implement this mod(s), either follow the instructions in this text file (and miniimages.txt for the image mod) or use a text compare tool such as 'beyond compare' to compare your files with those included in this zip.

Legend:  Download   Report
Expand All / Collapse All
Only works on older version Oscommerce ke-inc 5 Jun 2008  

Sorry forgot to mention,

This contribution does not work on the latest OSC release 2.2RC 2a.

Only works on older oscommerce versions! Unless later someone can upgrade this coding:

Comment by stooni:

Line 214
from:--------------
switch ($column_list[$sort_col-1]) {
case 'PRODUCT_LIST_SORT_ORDER':
$listing_sql .= " p.products_sort_order , pd.products_name " . ($sort_order == 'a' ? 'asc' : '');
break;
to-----------------
switch ($column_list[$sort_col-1]) {
case 'PRODUCT_LIST_SORT_ORDER':
$listing_sql .= " order by p.products_sort_order , pd.products_name " . ($sort_order == 'a' ? 'asc' : '');
break;

Total revised version by Beermoster works perfectly!! ke-inc 5 Jun 2008  
Ignore fix below, this is correct gwynwyffar 10 Apr 2008  
SQL Syntax Error gwynwyffar 9 Apr 2008  
Sort Categories As Well v1.1 akvario 25 Nov 2007  
Sort Categories As Well sashaben 19 Nov 2007  
Totally Revised Version Beer Monster 5 Aug 2005  
onclick event problem Bryan Clark 12 Jun 2005  
Bug Fix Brian Sim 7 Jan 2005  
Bug Fix Brian Sim 7 Jan 2005  
Custom sort order field for products in admin/categories.php Brian Sim 20 Oct 2004