jps001 Posted May 14, 2010 Posted May 14, 2010 I guess it is in index.php somewhere in sthis section if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_NAME') { // BOF Product Sort $HTTP_GET_VARS['sort'] = 'products_sort_order'; $listing_sql .= " order by p.products_sort_order asc"; // EOF Product Sort break; } } } else { $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1); $sort_order = substr($HTTP_GET_VARS['sort'], 1); switch ($column_list[$sort_col-1]) { case 'PRODUCT_LIST_MODEL': $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_NAME': $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : ''); break; case 'PRODUCT_LIST_MANUFACTURER': $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_QUANTITY': $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_IMAGE': $listing_sql .= " order by pd.products_name"; break; case 'PRODUCT_LIST_WEIGHT': $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_PRICE': $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; // BOF Product Sort case 'PRODUCT_SORT_ORDER': $listing_sql .= "p.products_sort_order " . ($sort_order == 'd' ? "desc" : '') . ", pd.products_name"; break; // EOF Product Sort But i am not a programmer so if someone can help me out, Greetings, Jasper Quote
jps001 Posted May 14, 2010 Posted May 14, 2010 Found it in index.php change $listing_sql .= " order by p.products_sort_order asc"; to $listing_sql .= " order by p.products_sort_order asc, pd.products_name"; Quote
dougfal Posted September 23, 2010 Posted September 23, 2010 Thanks for this contribution. It is working fine, except for an error in New Product or Edit Existing Product pages in admin. Each of these gives the error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/glbc00/public_html/catalog/admin/includes/functions/database.php on line 99 Anybody able to shed light on this? TIA. Cheers, Doug Quote
Wiedzkam Posted September 6, 2011 Posted September 6, 2011 Great contribution - I've installed version 1.4 and working great. We have a lot of products which are used in more than one category and so we need to be able to order the position of a product within each category seperately. So I've stored the order ranking on the products_to_categories table and altered the index.php code accordingly. I'm afraid our code is a bit too far off standard to release as a contribution, but if it helps anyone, just drop me a line, cheers, Dave Hi Dave, this is quite some time after you posted your comment, but maybe you are still somwhere around. I would be greatefull if you could shine some light about how to achieve sorting in situation you described - some products being used in more than one category, and in need to being sorted differently for each of them. Or maybe someone else might help with this... Quote
Wiedzkam Posted September 6, 2011 Posted September 6, 2011 Ver 1.7.8. And - there is another problem I run into. When using the individual product sort page, I can choose whatever string (letters and digits) for sorting. BUT when trying to use the SORT module/option from Administrator menu, I get an error 1054 - Unknown column 'TRAEG0B' in field list UPDATE products SET products_sort_order = TRAEG0B WHERE products_id = 422 The sort_order is set for CHAR (also tried VARCHAR, TEXT) with same outcome. When using the digits only - it works OK. Where could be the problem and how to solve it ? Quote
Supertex Posted September 13, 2011 Posted September 13, 2011 Any chance that a 2.3.1-compatible version is on the horizon? This would solve a huge problem for me, but after using winmerge to compare, my guess is that this won't work with 2.3.1 in current form. Quote osC v2.3.1 MySQL v8.0.32 PHP v5.6.40 Installed addons: . Attribute Sets Plus .. Create Account & Manual Order Maker .. Customer Testimonials 2.3.4 .. Customer Blacklist .. Dynamic Info Pages .. FedEx Web Svcs v9 .. Filtered Sales Report .. Generic Box .. Google XML Sitemap SEO .. Maximum Order Value .. Modular Front Page .. Monthly Sales & Tax Report .. Multiple Products Manager .. Must Accept Terms & Conditions .. Order Editior .. PDF Customer Invoice .. Price in Cart Only .. Product Sort/Order .. Product Sort in Cart .. Quantity Discounts .. Restrict Delivery Methods .. SEO Header Tags - Reloaded .. Separate Pricing Per Customer .. Simpler Admin Session Length Control .. Sitemap SEO .. Show Free Ship + Modules .. Specials by Category for SPPC .. Store Mode (open|closed|maintenance) .. Store Pickup Shipping .. Theme Switcher .. Ultimate SEO URLs 5 Pro .. UPS XML Rates & Svcs 1.4 .. USPS methods 7.3.1 .. Who's Online Dashboard . Fixes: Add to cart -> 'product not found' : FIX Login issues with IE 11 : FIX Tools: Incredibly Handy: osC Xref
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.
Note: Your post will require moderator approval before it will be visible.