I'm using Ubercart and would like to use VBO to bulk change the payment status of multiple orders. For instance, from Pending to Complete for orders paid by check.

I noticed that VBO comes with rules already for Node, but not for Ubercart order. Where can I get the rules or how would I create them.

Sorry if this is a noob question...

Thanks

Comments

infojunkie’s picture

Status: Active » Fixed

Sorry for the late reply. You need to find an action for the Ubercart orders. That would typically be located in an Ubercart sub-module. If you can't find it, it's best to ask the UC folks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jienckebd’s picture

I know UC isn't part of Drupal core, but VBO might want to consider including this action given how popular UC is. From what I can see, UC also doesn't have a good way of bulk changing the status of orders. Here's a quick action I wrote to change the status of an order.

function luminary_network_change_order_status_action_info() {
	return array('luminary_network_change_order_status_action' => array(
		'type' => 'uc_order',
		'label' => t('Change Order Status'),
		'configurable' => TRUE,
		'triggers' => array('any'),
	));
}

function luminary_network_change_order_status_action_form($context) {
	
	$options_order_status = array();
	$options_order_status['_active'] = t('Active');
	foreach (uc_order_status_list() as $status => $name) {
		$options_order_status[$name['id']] = $name['title'];
	}
  
	$form['general'] = array(
		'#type' => 'fieldset',
		'#title' => t('Change Order Status'), 
		'#description' => t('Changed the status of the selected orders.'),
		'#collapsible' => TRUE, 
		'#collapsed' => FALSE,
		'#weight' => 1,
	);

	$form['general']['new_status'] = array(
		'#type' => 'radios',
		'#title' => t('Change Order Status'),
		'#options' => $options_order_status,
		'#weight' => 0,
		'#required' => TRUE,
		'#description' => t('Change the status of the selected orders.'),
	);
   
  return $form;
}

function luminary_network_change_order_status_action_submit($form, $form_state) {
	return array(
		'new_status' => $form_state['values']['new_status'],
	);
}

function luminary_network_change_order_status_action(&$entity, $context) {

	$new_status = $context['new_status'];
	
	$update_order = uc_order_update_status($entity->order_id, $new_status);
  
}
infojunkie’s picture

Project: Views Bulk Operations (VBO) » Ubercart
Version: 6.x-1.x-dev » 6.x-2.x-dev
Component: Core » Orders
Category: support » feature
Status: Closed (fixed) » Needs work

This is best discussed as a feature request to UC. Please rewrite your action as a patch against the latest UC dev and mark this issue as "needs review" when done.

longwave’s picture

Status: Needs work » Closed (duplicate)

Views integration in Ubercart 6.x-2.x is handled in the uc_views project. There is an open feature request for this at #1701918: New feature: Arbitrarily change order status with bulk operations although it is unlikely to be committed as Drupal 6 is reaching end of life.