Jump to content
thirty bees forum
  • 0

Deleting old Shopping Carts


Question

Posted

In Prestashop 1.6.24 ( and earlier versions ) it was not possible to delete Shopping Carts that have been converted into orders.
Although the Customers/Shopping Carts screen in the BO gives a Delete option in the View dropdown clicking it displays 
Deleted Selected Item? in an alert box. Selecting OK then produces "An Error Occurred during Deletion" at the top of the screen.

ThirtyBees 3.0 seems to have inherited this behaviour.

I can't see the need to retain Shopping Carts which have been converted into orders. I've carts going back to 2014. The order details are still available.

If there is some hidden technical reason? If there is why show the Delete option?

As a test I've manually deleted entries for a customer in tb_cart_product and tb_cart - [ on a test server ]

This had the desired tidying up effect but I'm wondering if I could have stored up some future problem? 

 

 

ShoppingCartProblem.jpg

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

I'm only keeping shopping carts from current year.

Every end of the year, I clean many things in webshop with Database Optimization module

https://mypresta.eu/modules/administration-tools/database-optimization.html

However, deleting the carts which are associated with orders was removed with new version, so you just need to delete some lines in following file ../modules/dboptimization/dboptimization.php

Lines to delete: L154,L155,L156,L158

After deletion it should look like this:

L152   public function dbcounter($table)
L153   {
L154        $query = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT count(*) AS count FROM `' . _DB_PREFIX_ . $table . '`');
L155        return $query[0]['count'];
L156    }

 

Edited by toplakd
  • Like 1

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