ecomeal Posted March 27, 2007 Posted March 27, 2007 Is it possible to sort products on email confirmation and invoice in alphabetical, or any other order? Products are listed in the order they were added to shopping cart. I found contribution 'Alphabetical Order Product Listing' that claims changing $orders_products_query in includes/classes/order.php ( by adding ORDER BY in select) should do the trick, but not for me. Did anyone try? Thank you for your help V
ecomeal Posted March 28, 2007 Author Posted March 28, 2007 I think I figured it out. If you would like to sort email order confirmation, or shopping cart in any order use: function compare($x, $y) { $retval = strnatcmp($x['quantity'], $y['quantity']); if(!$retval) return strnatcmp($x['name'], $y['name']); return $retval; } usort($products, 'compare'); Let me know if you have any questions. www.OrganicDirect.com
oww_ Posted July 2, 2007 Posted July 2, 2007 hello ecomeal, where did you include the code exactly? thanks, oliver (...) function compare($x, $y) { $retval = strnatcmp($x['quantity'], $y['quantity']); if(!$retval) return strnatcmp($x['name'], $y['name']); return $retval; } usort($products, 'compare');
oww_ Posted July 5, 2007 Posted July 5, 2007 o.k. - helped myself... :) http://forums.oscommerce.de/index.php?s=&a...st&p=261263
SanEva Posted April 11, 2008 Posted April 11, 2008 I've tried to make the changes posted on the German oscommerce forum (although my german is not very good.....) but there doesn't seem to make any difference to the order of the products in the shoppingcart at all when I make an order. And when I come to 'checkout_process.php' I get an error: Warning: usort() [function.usort]: The argument should be an array in xxxxxx/checkout_process.php on line 306 (One warning for every item) Warning: Cannot modify header information - headers already sent by (output started at xxxxxxx/checkout_process.php:306) in xxxxxx/includes/functions/general.php on line 33 Any idea of what to do?
Guest Posted April 19, 2008 Posted April 19, 2008 I've tried to make the changes posted on the German oscommerce forum (although my german is not very good.....) but there doesn't seem to make any difference to the order of the products in the shoppingcart at all when I make an order. And when I come to 'checkout_process.php' I get an error:Warning: usort() [function.usort]: The argument should be an array in xxxxxx/checkout_process.php on line 306 (One warning for every item) Warning: Cannot modify header information - headers already sent by (output started at xxxxxxx/checkout_process.php:306) in xxxxxx/includes/functions/general.php on line 33 Any idea of what to do? Have a look in the knowledgebase for Cannot modify header information - headers already sent by
Recommended Posts
Archived
This topic is now archived and is closed to further replies.