This is a discussion on Sort by price? within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; I want to sort my category listing by price. I have deduced that it's not in product_listing_col.php, because I put ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| I want to sort my category listing by price. I have deduced that it's not in product_listing_col.php, because I put sort by price ASC in the $pg_query, and ran the query string through PHPMyAdmin, and it returned empty set, but my page shows products, so I know that the query must be passed from somewhere else but I don't know where. I see in index.php that there are references to $HTTP_GET_VARS and whether sort by price has been 'requested' and I think I remember this in the Admin of another OSC version, and I don't know how to pass the variables to index.php to make the categories list sort by price. Any tips appreciated. Ken |
|
#2
| |||
| |||
| I found that appending &sort=3a to my URL, like index.php?cPath=1_17&sort=3a does what I want. Now, how to get that appended onto the URL produced by clicking on the category in the categories box or from the categories list? |
|
#3
| |||
| |||
| I am having the same issue. Any luck? |
|
#4
| |||
| |||
| |
|
#5
| |||
| |||
| Sorry to bump this but I thought it would be a good addition to the thread. To sort by lowest first you would use ?sort=3a, to sort by highest to lowest it's ?sort=3d. IF you want to do this in your product listings, apply the following examples. I'm running RC3 using product listing columns (product_listing_col.php). You may style these links however you see fit. PHP Code: Hope it helps someone.. Regards |
| The Following User Says Thank You to dead7 For This Useful Post: | ||
michael_s (02-02-2007) | ||
|
#6
| |||
| |||
| I used this code on index_products.tpl right after the normal category sort at about line 60 Code: // Additional Products Sort
echo '<td align="center" class="main">' . 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('' => 'Select',
'4a' => 'Price Low to High',
'4d' => 'Price High to Low',
'3a' => 'Products Name A to Z',
'3d' => 'Products Name Z to A');
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
|
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Separate Price per customer additional price box | auntie22 | osCMax v1.7 Discussion | 0 | 06-05-2006 08:12 AM |
| attribute sort | timbrrr | osCMax v2 Customization/Mods | 3 | 01-17-2006 12:24 PM |
| Sort by price question | moreduff | osCMax v1.7 Discussion | 1 | 08-02-2005 07:32 AM |
| Sort products by price | Anonymous | osCMax v1.7 Discussion | 3 | 06-02-2005 04:55 AM |
| Add Delivery Price based on Total Price | mikeyboy | osCMax v1.7 Discussion | 1 | 01-30-2004 09:24 AM |