Transistor Posted January 12, 2008 Share Posted January 12, 2008 I wanted to do two things. 1. Present the category views sorted by product code. I've succeeded doing this by adding "ORDER BY productCode" to line 166 of includes/content/viewCat.inc.php. See below: $productListQuery = "SELECT ".$glob['dbprefix']."CubeCart_cats_idx.cat_id, ".$glob['dbprefix'] ."CubeCart_cats_idx.productId, productCode, quantity, description, image, price, name, popularity, sale_price, stock_level, useStockLevel FROM " .$glob['dbprefix']."CubeCart_cats_idx INNER JOIN ".$glob['dbprefix']."CubeCart_inventory ON " .$glob['dbprefix']."CubeCart_cats_idx.productId = ".$glob['dbprefix']."CubeCart_inventory.productId WHERE " .$glob['dbprefix']."CubeCart_cats_idx.cat_id = ".$db->mySQLSafe($_GET['catId']) ." ORDER BY productCode"; (The line is one long line in the original script.) 2. Now I want to show the basket sorted by productCode but haven't figured it out yet. I think it would have to be a similar mod in includes/content/cart.inc.php. Any ideas anyone? Many thanks. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 14, 2008 Share Posted January 14, 2008 ...show the basket sorted by productCode. I think it would have to be in includes/content/cart.inc.php.You might think. But the best place might be in (1) cart.inc.php, or perhaps (2) add a new function to the cart class. For each visitor, CC asks PHP to create a session. The session ID is stored in the database table "CubeCart_sessions". The basket contents are "serialized". You would need to do a lot of discovery to understand the serialization of the cart. (1) You would need to write new code to sort $basket at about line 44 (or maybe near line 354). Or, (2) You would need to write new code in the cart class to add a sort function to the class. Quote Link to comment Share on other sites More sharing options...
Transistor Posted January 14, 2008 Author Share Posted January 14, 2008 Yes, I had a look at the session serialisation. It may be more trouble than it's worth. Thanks for your reply. 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.