designbysue Posted March 30, 2010 Share Posted March 30, 2010 I need to add a drop down for visitors to sort products from A - Z, Z - A and Price Lowest to Highest and Highest to Lowest. The add on here http://addons.oscommerce.com/info/4312/v,22 does this but also by bestseller. I have looked over the code to try to remove the bestseller option but can't figure it out. Can someone please help me remove the bestsellers from this add on? (the bestseller sort is tied to cron) Thanks Sue Quote Link to comment Share on other sites More sharing options...
designbysue Posted March 31, 2010 Author Share Posted March 31, 2010 I actually got it!! for anyone else who wants this you simply add the following code (to index.php) // Additional Products Sort echo '<td align="center" class="dynamicMain">' . tep_draw_form('sort', FILENAME_DEFAULT, 'get') . '<b>Sort by:</b> '; if (isset($HTTP_GET_VARS['manufacturers_id'])) { echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']); } else { echo tep_draw_hidden_field('cPath', $cPath); } $sort_list = array('1a' => 'Products Name A to Z', '1d' => 'Products Name Z to A', '5a' => 'Price Low to High', '5d' => 'Price High to Low'); foreach($sort_list as $id=>$text) { $sort_range[] = array('id' => $id, 'text' => $text); } echo tep_draw_pull_down_menu('sort', $sort_range, (isset($HTTP_GET_VARS['sort']) ? $HTTP_GET_VARS['sort'] : ''), 'onchange="this.form.submit()"'); echo tep_draw_hidden_field('filter_id', (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : '')); echo '</form></td>' . "\n"; // End Additional Products Sort after echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); echo '</form></td>' . "\n"; } and before } Be sure to follow the directions from the add on here link to be sure your name and price number are correct. (All I did was remove the best sellers from the drop down and used only this code on the index.php as it appears that all of the other code for the add on had to do with the info needed for the best sellers sort) Sue Quote Link to comment Share on other sites More sharing options...
eprom Posted May 11, 2010 Share Posted May 11, 2010 (edited) Hi Sue, when I use your code I get this error: Parse error: syntax error, unexpected T_STRING in ..../index.php on line 341 Any tips to solve this? Edited May 11, 2010 by eprom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.