Jump to content

Delete all carts in administration


WEBDVL

Recommended Posts

The only way I can think of to delete all your carts is to run an SQL query. For example, the following query will delete all carts that didn't end up as order:

DELETE FROM `ps_cart` WHERE `id_cart` NOT IN (SELECT `id_cart` FROM `ps_orders`);
DELETE FROM `ps_cart_discount` WHERE `id_cart` NOT IN (SELECT `id_cart` FROM `ps_orders`);
DELETE FROM `ps_cart_product` WHERE `id_cart` NOT IN (SELECT `id_cart` FROM `ps_orders`);



Change ps_ to your database prefix. Make a backup of your ps_cart, ps_cart_discount and ps_cart_product tables in case something goes wrong. The only problem with this is that all your customers will lose whatever they currently have in their cart and will have to start over.

Link to comment
Share on other sites

  • 3 weeks later...

I added $this->delete = true; and I didn't see a difference in the cart (Back Office >> Customers >> Carts)

/admin/tabs/AdminOrders.php

class AdminOrders extends AdminTab
{
   public function __construct()
   {
       global $cookie, $currentIndex;

        $this->table = 'order';
        $this->className = 'Order';
        $this->view = true;
       $this->colorOnBackground = true;
       $this->delete = true;




Am I doing something incorrectly?

Link to comment
Share on other sites

  • 1 month 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...