Jump to content
thirty bees forum

Recommended Posts

Posted

Hello,

While I did this little improvments on the stores today, I thought this one might be useful to some of you. My aim was to quickly delete the 0€ carts that are taking dust on the database. Those are generated when a customer click on the cart button but don't have any product in it.

Instead on relying on a module I just did the following changes on our 1.6 (same as TB) : Go to controllers/admin/AdminCartsController.php and edit the following lines :

``` Before : 'total' => array( 'title' => $this->l('Total'), 'callback' => 'getOrderTotalUsingTaxCalculationMethod', 'orderby' => false, 'search' => false, 'align' => 'text-right', 'badge_success' => true ),

After : 'total' => array( 'title' => $this->l('Total'), 'callback' => 'getOrderTotalUsingTaxCalculationMethod', 'orderby' => true, //set true instead of false 'search' => true,//set true instead of false 'align' => 'text-right', 'badge_success' => true ), ```

Now, you'll be able to sort your cart by amount. You just need to do a little select all and hit delete to see all those useless carts disappear ;)

I know it's bad to edit controller files directly since this should be done with override. But anyway, what do you think about bringing this change on the next core version of TB ? Unless there is something I'm unaware of, this should make merchants life easier and would help people with cleaning those useless carts.

screenshot

Posted

I think its very little saving. I have 16K++ records and it just have 5.6Mb in tbcart and 2.5Mb in tbcart_product. so I think it will be fine if we don't delete useless cart :)

Posted

Maybe even hardcoding such a criterion. Like removing empty carts after the time which is also used for cookie timeout. I can hardly see any use for empty carts, but maybe I'm missing something.

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