Jump to content

Abandoned Carts


Recommended Posts

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

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 by phrasespot (see edit history)
Link to comment
Share on other sites

  • 6 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...