DoctorLarry Posted December 17, 2003 Posted December 17, 2003 OK, I think I'm having a brain freeze today ! What I would simply like to do is to sort the product's within a given catagory on the Admin side by the products_model instead of the default products_name. I've managed to include a column for the model (see below code). However, I can't figure out how to change the stupid sort order to the displayed model vs. the alphabetical name ??? The problem is that I've got thousands of additional item's to be added for which some have the same "name" but are all uniquely different. However, each item has been sequential numbered as the "model". Thus, it'll make it a lot easier to locate & edit a particular item by it's model vs. the name. Especially when I've got some item with as many as 30 duplicate names. Adding the model column helps identify which one it is but it would still be nice to have them descend in the sequentially numbered order as well. Admin/categories.php <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $products['products_model'] . ' ' . $products['products_name']; ?></td> <td class="dataTableContent" align="center"> PS: Just in case your wondering, My catalog already list the product's by model. PrinceFanAttic.com There is no Peak to the "Learning Curve",.. Only the limits for which we challenge our selves. The answer dwells within the "MATRIX" of our minds. My brain hurts from trying to bend the damn spoon !
DoctorLarry Posted December 17, 2003 Author Posted December 17, 2003 My Brain Freeze finally thawed out ! Problem #2 solved; Just had to change pd.products_name to p.products_model :P if ($HTTP_GET_VARS['search']) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_quantity, p.products_image, p.products_thumb, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . $HTTP_GET_VARS['search'] . "%' order by p.products_model"); } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_quantity, p.products_image, p.products_thumb, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by p.products_model"); Problem #1 still pending ? Wish this other delima would be as easy to solve: Need all the help I can get. Please take a look ! http://www.oscommerce.com/forums/index.php?showtopic=70252&hl= There is no Peak to the "Learning Curve",.. Only the limits for which we challenge our selves. The answer dwells within the "MATRIX" of our minds. My brain hurts from trying to bend the damn spoon !
Recommended Posts
Archived
This topic is now archived and is closed to further replies.