Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default 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.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Items in Saved Cart Sort Order

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

    and around line 149 or so change:
    Code:
        $products_query = "select products_id, customers_basket_quantity
                             from " . TABLE_CUSTOMERS_BASKET . "
                             where customers_id = '" . (int)$_SESSION['customer_id'] . "'";
    to read:
    Code:
        $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 ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default 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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default 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.

  5. #5
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Items in Saved Cart Sort Order

    Quote Originally Posted by chadderuski View Post
    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?
    Last edited by mc12345678; 13 May 2016 at 07:40 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Deleting Saved Items in Cart
    By thegoodlifestore in forum Managing Customers and Orders
    Replies: 6
    Last Post: 27 Mar 2012, 11:26 PM
  2. Cart items not saved in Opera
    By Magic Muscle in forum General Questions
    Replies: 4
    Last Post: 17 Mar 2011, 04:50 AM
  3. Saved Cart Items From Last Session
    By lucchesi in forum General Questions
    Replies: 5
    Last Post: 30 Dec 2010, 04:36 PM
  4. Saved cart items from previous session
    By Loque in forum Managing Customers and Orders
    Replies: 25
    Last Post: 15 Aug 2008, 09:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR