Views Bulk Operation 7.x-3.3 breaks ubercart set order status operation. As a temporary fix we’ve created a module that will be able to change the order status. Download and enable the module, then enable the new operation Update Ubercart Order Status in VBO field settings.

Download Module

<?php

//hook_action_info
function vbo_ubercart_action_info() {
 return array(
 'vbo_ubercart_order_update_action' => array(
 'type' => 'uc_order',
 'label' => t('Update Ubercart Order Status'),
 'permissions' => array('access content', 'administer site configuration'),
 'behavior' => array('changes_property'),
 'configurable' => FALSE,
 'vbo_configurable' => TRUE,
 'triggers' => array('any'),
 ),
 );
}

function vbo_ubercart_order_update_action_form($settings, &$form_state) {
 $form = array();
 $form['order_status'] = array(
 '#type' => 'select', 
 '#title' => t('Select the Order Status to change to'),
 '#options' => uc_order_status_options_list(),
 '#required' => TRUE,
 );
 return $form;
}

function vbo_ubercart_order_update_action_submit($form, $form_state) {
 $return = array(); 
 $return['status'] = $form_state['values']['order_status'];
 return $return;
}

function vbo_ubercart_order_update_action(&$entity, $context) { 
 $entity->order_status = $context['status'];
 uc_order_update_status($entity->order_id, $context['status']);
}

One Response to “Views Bulk Operation 7.x-3.3 breaks ubercart set order status operation”

  1. ANDiTKO

    Thanks. The module works perfectly!
    Fixed the issue i had after updating VBO

Comments are closed.