You are here

vbo_delete_uc_orders.module in Bulk Delete Ubercart orders 7

Simple module to delete orders using Views bulk order module.

File

vbo_delete_uc_orders.module
View source
<?php

/**
 * @file
 * Simple module to delete orders using Views bulk order module.
 */

/**
 * Implements hook_action_info().
 */
function vbo_delete_uc_orders_action_info() {
  return array(
    'vbo_delete_uc_orders_delete' => array(
      'type' => 'entity',
      'label' => t('Delete order'),
      'configurable' => FALSE,
      'behavior' => array(
        'deletes_property',
      ),
    ),
  );
}

/**
 * Delete order using VBO.
 */
function vbo_delete_uc_orders_delete($entity, $context) {
  $info = entity_get_info($context['entity_type']);
  $entity_id = $entity->{$info['entity keys']['id']};
  uc_order_delete($entity_id);
}

Functions

Namesort descending Description
vbo_delete_uc_orders_action_info Implements hook_action_info().
vbo_delete_uc_orders_delete Delete order using VBO.