Jump to content
thirty bees forum

Sort Cart controller by total amount


Gotabor

Recommended Posts

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

Link to comment
Share on other sites

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