Forums / Managing Customers and Orders / Items in Saved Cart Sort Order

Items in Saved Cart Sort Order

Results 1 to 5 of 5
13 May 2016, 15:26
#1
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Posts:
986
Plugin Contributions:
0

Items in Saved Cart Sort Order

Hello,

What controls the sorting of the items once added to the cart?

This is the situation:

I have several customers that are placing order with 50+ individual items. While items are being added, they are in the same order as they are added.

BUT, once they log out and log backing, their "saved" cart is no longer in the same order and has be resorted in some manner. It's NOT by item number or Name either.

This resorting also affects the order confirmation.

So, how can I ensure that the saved cart is in the same order it as items were originally added?

Thank you.
13 May 2016, 15:48
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: Items in Saved Cart Sort Order

You could edit the file:
/includes/classes/shopping_cart.php

and around line 149 or so change:
    $products_query = "select products_id, customers_basket_quantity
                         from " . TABLE_CUSTOMERS_BASKET . "
                         where customers_id = '" . (int)$_SESSION['customer_id'] . "'";


to read:
    $products_query = "select products_id, customers_basket_quantity
                         from " . TABLE_CUSTOMERS_BASKET . "
                         where customers_id = '" . (int)$_SESSION['customer_id'] . "'
                         order by customers_basket_id";


NOTE: this is already done in more current, updated and more secure versions of Zen Cart ...
13 May 2016, 16:15
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Items in Saved Cart Sort Order

A note to this is that at least in newer versions of ZC the effect ends up being that if a cart has a product in it before login, the previously saved items (if different from the ones in the cart) are added to the top of the cart with the existing, non-matching product after.
13 May 2016, 16:32
#4
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Posts:
986
Plugin Contributions:
0

Re: Items in Saved Cart Sort Order

Thanks for the fix!

Yes, working on updating, but since no payments are processed through the site it hasn't been high on the list.
13 May 2016, 18:38
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Items in Saved Cart Sort Order

chadderuski:

Thanks for the fix!

Yes, working on updating, but since no payments are processed through the site it hasn't been high on the list.

Umm.. kinda seems like the two may be related. :) or did I miss something?

Edit: do you mean the site has never taken money and that it is processed by some other method or did you mean that it is having trouble processing payments?