santaya Posted April 9, 2008 Posted April 9, 2008 I want to sort the cart so that when an item is added, it shows at the top of the list instead of the bottom as it does now. I have added the following at line 116 of classes/shopping_cart. //sort in cart $this->reset(false); $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' order by customers_basket_id DESC "); while ($products = tep_db_fetch_array($products_query)) { $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']); It almost works. But it lags by one item. When you add the first item the cart remains empty. Then when you add item 2, item 1 shows up (but not 2), etc. The second problem (though not a big one for me) is that unless the customer is logged in, he can't put anything in the cart. Any help would be greatly appreciated!
burt Posted April 9, 2008 Posted April 9, 2008 Do you want this in the shopping cart BOX, or the shopping cart PAGE, or both ?
santaya Posted April 9, 2008 Author Posted April 9, 2008 Do you want this in the shopping cart BOX, or the shopping cart PAGE, or both ? I really want it on the shopping cart page. Thanks.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.