Guest iiluxury Posted September 7, 2006 Share Posted September 7, 2006 Any mod allow me to sort orders by status. cos I am getting too many pending orders. I dont want see them. I want to see processing orders in a screen. thanks. Quote Link to comment Share on other sites More sharing options...
Guest peppy Posted September 7, 2006 Share Posted September 7, 2006 go to /admin/orders/ and edit index.php search for: // query database if(isset($_GET['page'])){ $page = $_GET['page']; } else { $page = 0; } $ordersPerPage = 25; $query = "SELECT ".$glob['dbprefix']."CubeCart_customer.customer_id, status, cart_order_id, time, title, firstName, lastName, ip, prod_total, ".$glob['dbprefix']."CubeCart_customer.email FROM ".$glob['dbprefix']."CubeCart_order_sum INNER JOIN ".$glob['dbprefix']."CubeCart_customer ON ".$glob['dbprefix']."CubeCart_order_sum.customer_id = ".$glob['dbprefix']."CubeCart_customer.customer_id ".$sqlQuery." ORDER BY time DESC"; $results = $db->select($query, $ordersPerPage, $page); $numrows = $db->numrows($query); $pagination = $db->paginate($numrows, $ordersPerPage, $page, "page"); ?> and replace it with this: // query database if(isset($_GET['page'])){ $page = $_GET['page']; } else { $page = 0; } $ordersPerPage = 25; $query = "SELECT ".$glob['dbprefix']."CubeCart_customer.customer_id, status, cart_order_id, time, title, firstName, lastName, ip, prod_total, ".$glob['dbprefix']."CubeCart_customer.email FROM ".$glob['dbprefix']."CubeCart_order_sum INNER JOIN ".$glob['dbprefix']."CubeCart_customer ON ".$glob['dbprefix']."CubeCart_order_sum.customer_id = ".$glob['dbprefix']."CubeCart_customer.customer_id ".$sqlQuery." ORDER BY status DESC"; $results = $db->select($query, $ordersPerPage, $page); $numrows = $db->numrows($query); $pagination = $db->paginate($numrows, $ordersPerPage, $page, "page"); ?> although i dont know if you have to order it ASC or DESC, just try it out :) Quote Link to comment Share on other sites More sharing options...
Guest vrakas Posted September 7, 2006 Share Posted September 7, 2006 Nice one peppy Added here :) Quote Link to comment Share on other sites More sharing options...
Guest peppy Posted September 7, 2006 Share Posted September 7, 2006 *feeling great* (can you add my current avatar {smiley here} behind the name of the topic ? ) i love this smiley it makes me happy :) Quote Link to comment Share on other sites More sharing options...
Guest Captain Bags Posted December 13, 2006 Share Posted December 13, 2006 Thanks, peppy - I wasn't sure where to make the ORDER BY change. The trouble is that it sorts on the status ID: 1 = Pending, 2 = Processing, 3 = Completed etc. That simple change either shows all Pending first (ASC) or all Completed first (DESC). I need to see Processing first, followed by Pending, and then all the rest. My SQL coding is very rusty but I think it needs a UNION Anybody up to the challenge? :blink: Quote Link to comment Share on other sites More sharing options...
Guest murkington Posted February 2, 2007 Share Posted February 2, 2007 I'm also very interested in this as well, anyone know how to do this? I'm a novice compared to most of you guys on here. Thanks, peppy - I wasn't sure where to make the ORDER BY change. The trouble is that it sorts on the status ID: 1 = Pending, 2 = Processing, 3 = Completed etc. That simple change either shows all Pending first (ASC) or all Completed first (DESC). I need to see Processing first, followed by Pending, and then all the rest. My SQL coding is very rusty but I think it needs a UNION Anybody up to the challenge? Quote Link to comment Share on other sites More sharing options...
Guest craiga Posted May 4, 2007 Share Posted May 4, 2007 I'm also very interested in this as well, anyone know how to do this? I'm a novice compared to most of you guys on here. Thanks, peppy - I wasn't sure where to make the ORDER BY change. The trouble is that it sorts on the status ID: 1 = Pending, 2 = Processing, 3 = Completed etc. That simple change either shows all Pending first (ASC) or all Completed first (DESC). I need to see Processing first, followed by Pending, and then all the rest. My SQL coding is very rusty but I think it needs a UNION Anybody up to the challenge? Perhaps use: order by field(status, 3, 1, 2) desc Quote Link to comment Share on other sites More sharing options...
Guest Posted May 5, 2007 Share Posted May 5, 2007 I (with help of a friend to get the syntax right), did a dropdown for sorting order status...only problem is has if it breaks if you have more than one page - which personally, I switched $ordersperpage = 2500; so I could view them all on one page anyway. This also sorts your order by date - newest on top, oldest on bottom which is how I like it. Of course you can change it. In admin/orders/index.php .... Find about line 84: $ordersPerPage = 25; Add after it: if (isset($_GET['updatestatus'])) { if (($_GET['updatestatus']) == "now") { $newstatus=@strip_tags($_POST['newstatus']); Right after this, is the original $query statement: $query = "SELECT ".$glob['dbprefix']."CubeCart_customer.customer_id, status, cart_order_id, time, title, firstName, lastName, ip, prod_total, ".$glob['dbprefix']."CubeCart_customer.email FROM ".$glob['dbprefix']."CubeCart_order_sum INNER JOIN ".$glob['dbprefix']."CubeCart_customer ON ".$glob['dbprefix']."CubeCart_order_sum.customer_id = ".$glob['dbprefix']."CubeCart_customer.customer_id ".$sqlQuery." ORDER BY status ASC"; Replace it with: $query = "SELECT ".$glob['dbprefix']."CubeCart_customer.customer_id, status, cart_order_id, time, title, firstName, lastName, ip, prod_total, ".$glob['dbprefix']."CubeCart_customer.email FROM ".$glob['dbprefix']."CubeCart_order_sum INNER JOIN ".$glob['dbprefix']."CubeCart_customer ON ".$glob['dbprefix']."CubeCart_order_sum.customer_id = ".$glob['dbprefix']."CubeCart_customer.customer_id ".$sqlQuery." where status=".$newstatus." ORDER BY time DESC"; } } else { $query = "SELECT ".$glob['dbprefix']."CubeCart_customer.customer_id, status, cart_order_id, time, title, firstName, lastName, ip, prod_total, ".$glob['dbprefix']."CubeCart_customer.email FROM ".$glob['dbprefix']."CubeCart_order_sum INNER JOIN ".$glob['dbprefix']."CubeCart_customer ON ".$glob['dbprefix']."CubeCart_order_sum.customer_id = ".$glob['dbprefix']."CubeCart_customer.customer_id ".$sqlQuery." ORDER BY time DESC"; } Find about line 103: <p class="pageTitle"><?php echo $lang['admin']['orders']['orders']; ?></p> after it add (edit as needed for your statuses: <form action="index.php?updatestatus=now" method="post"> <select name="newstatus"> <option value="1">Pending</option> <option value="2">Awaiting Shipment</option> <option value="3">Complete</option> <option value="4">Declined</option> <option value="5">On Hold</option> <option value="6">Cancelled</option> <option value="7">Partial Order Shipped</option> </select> <input type="submit" name="submit" value="view" /> </form> That's it. Just save and upload the file. Quote Link to comment Share on other sites More sharing options...
fabien Posted August 18, 2007 Share Posted August 18, 2007 Thanks a lot for this modification... I've been looking for that since weeks. Slightly different need now is 'how to know which product is a best seller'. Not the one which is mostly seen on the store, but, based on sales records, how to order best sales ? Anyhow, thanks for this orders sorts mod... Fabien, for forcemajeure.com 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.