For all those who want to edit the Sort By: Dropdown box on the featured/all/new products pages:
Open these 3 files: (where YOURS is the name of your template)
#1 includes/templates/YOURS/templates/tpl_modules_listing_display_order.php
#2 includes/modules/listing_display_order.php
#3 includes/languages/YOURS/english.php
Open #1 includes/templates/YOURS/templates/tpl_modules_listing_display_order.php
From what my beginner standpoint can tell, this pretty much contains the sort by: dropdown menu. Comment out unwanted options and add new ones. For example I took out price (because everything on my site is $5) and I added manufacturer option. I use <!-- --> but you might prefer to use the /** */ comments. Each option starts at <option value… and goes to </option>
Mine (edited) looks like:
Code:<?php /** * Module Template * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_modules_listing_display_order.php 3369 2006-04-03 23:09:13Z drbyte $ */ ?> <?php // NOTE: to remove a sort order option add an HTML comment around the option to be removed ?> <div id="sorter"> <label for="disp-order-sorter"><?php echo TEXT_INFO_SORT_BY; ?></label> <?php echo zen_draw_form('sorter_form', zen_href_link($_GET['main_page']), 'get'); echo zen_draw_hidden_field('main_page', $_GET['main_page']); // echo zen_draw_hidden_field('disp_order', $_GET['disp_order']); echo zen_hide_session_id(); ?> <select name="disp_order" onchange="this.form.submit();" id="disp-order-sorter"> <?php if ($disp_order != $disp_order_default) { ?> <option value="<?php echo $disp_order_default; ?>" <?php echo ($disp_order == $disp_order_default ? 'selected="selected"' : ''); ?>><?php echo PULL_DOWN_ALL_RESET; ?></option> <?php } // reset to store default ?> <option value="1" <?php echo ($disp_order == '1' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_NAME; ?></option> <option value="2" <?php echo ($disp_order == '2' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_NAME_DESC; ?></option> <!--<option value="3" <?php echo ($disp_order == '3' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_PRICE; ?></option> <option value="4" <?php echo ($disp_order == '4' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_PRICE_DESC; ?></option> <option value="5" <?php echo ($disp_order == '5' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_MODEL; ?></option>--> <option value="6" <?php echo ($disp_order == '6' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_MANUFACTURER; ?></option> <option value="7" <?php echo ($disp_order == '7' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_MANUFACTURER_DESC; ?></option> <option value="8" <?php echo ($disp_order == '8' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_DATE_DESC; ?></option> <option value="9" <?php echo ($disp_order == '9' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_DATE; ?></option> </select></form></div>
Open #2 includes/modules/listing_display_order.php
You can add a case that correlates with whatever you want to add to the sort by: dropdown menu. I added an option m.manufacturers_name here. I'm not sure but there may be other options you can add here with it's p.product_whatever name.
Open #3 includes/languages/YOURS/english.phpCode:case ($_GET['disp_order'] == 6): $order_by = " order by m.manufacturers_name"; break; case ($_GET['disp_order'] == 7): $order_by = " order by m.manufacturers_name DESC"; break;
Scroll down to the section towards the bottom titled // sort order titles for dropdowns
. Add a line(s) that correlate with the TEXT_INFO_SORT_BY_WHATEVER lines that you may have added in the first file tpl_modules_listing_display_order.php.
For my example I added the manufacturer title (I call them artists because it's a CD site).
Code:// sort order titles for dropdowns define('PULL_DOWN_ALL_RESET','- RESET - '); define('TEXT_INFO_SORT_BY_PRODUCTS_NAME', 'Album Name (A-Z)'); define('TEXT_INFO_SORT_BY_PRODUCTS_NAME_DESC', 'Album Name (Z-A)'); define('TEXT_INFO_SORT_BY_PRODUCTS_PRICE', 'Price - low to high'); define('TEXT_INFO_SORT_BY_PRODUCTS_PRICE_DESC', 'Price - high to low'); define('TEXT_INFO_SORT_BY_PRODUCTS_MODEL', 'Model'); define('TEXT_INFO_SORT_BY_MANUFACTURER', 'Artist (A-Z)'); define('TEXT_INFO_SORT_BY_MANUFACTURER_DESC', 'Artist (Z-A)'); define('TEXT_INFO_SORT_BY_PRODUCTS_DATE_DESC', 'Date Added - New to


Reply With Quote
