Jimbola Posted April 12, 2012 Share Posted April 12, 2012 Hi all, I'l looking at the Customers>Carts screen on my admin, it used to show all the carts that had been generated but this became a huge list. Now it can't load the page. Is there anyway in my Database that I can easily delete carts that are over say 1 year old? or manage the carts data in any way. Thanks Link to comment Share on other sites More sharing options...
phrasespot Posted April 14, 2012 Share Posted April 14, 2012 (edited) Is there anyway in my Database that I can easily delete carts that are over say 1 year old? Take a DB backup first Assuming your table prefix is ps_ (modify accordingly if not) issue the following statement using PHPMyAdmin or similar DELETE FROM `ps_cart` WHERE `id_cart` NOT IN (SELECT `id_cart` from `ps_orders`) AND `date_upd` < DATE_SUB(NOW(), INTERVAL 1 YEAR) On re-consideration, this is a bad way to do it as it may, under some circumstances (e.g. when there are combinations for an item in a cart etc), leave your DB in an inconsistent state. Removing carts are quite a bit more involved than this, seek professional help. Edited October 26, 2012 by phrasespot (see edit history) Link to comment Share on other sites More sharing options...
ipcomp1 Posted October 26, 2012 Share Posted October 26, 2012 Hello do you know if this compitable to version 1.5.1 ? "DELETE FROM `ps_cart` WHERE `id_cart` NOT IN (SELECT `id_cart` from `ps_orders`) AND `date_upd` < DATE_SUB(NOW(), INTERVAL 1 YEAR)" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now