Ever tried to Delete bulk orders from UberCart?

This should do it. Quick and dirty, but it works...

File to modify is ~ uc_views_bulk_operations.module. Modified file is attached.

In function uc_views_bulk_operations_order_operations() add this to the array around line 52


    'delete_orders' => array(
      'label' => 'Delete Orders',
      'callback' => 'uc_views_bulk_operations_orders_delete_orders',
      'disabled' => TRUE,
    ),

Then add this at line 110


function uc_views_bulk_operations_orders_delete_orders($orders) {
  $args = implode(',', $orders);
  foreach($orders as $order_id) {
	
	  $order = uc_order_load($order_id);
	  uc_order_delete($order_id);
	}
}

CommentFileSizeAuthor
uc_views_bulk_operations.module.zip1.56 KBpsy

Comments

madsph’s picture

Sorry for not responding before now - I have been in the hospital (broke my leg :-( ).

I have tried out your patch, and it works like a charm.

I have committed it to the dev branch. Thank you once again for a great contribution,

madsph’s picture

Status: Active » Closed (fixed)
jasonabc’s picture

thanks for this - very useful!!

hockey2112’s picture

Hi, how do I access the functions of this module after I have installed it? Is there a particular URL or menu link I can click?