I have a role of 'Sales Manager' - they have access to manage the orders.
On the dropdown for Order statuses I can see the following .
On the dropdown for Order statuses I can see the following .
What I'd like to do though is limit this to - Pending, Process and Completed.
To fix this the following code works a treat.
/***
* Implements hook_commerce_order_status_info_alter
*/
function my_commerce_patch_commerce_order_status_info_alter(&$order_statuses){
global $user;
if (in_array('sales manager', $user->roles)) {
unset($order_statuses['cart']);
unset($order_statuses['checkout_checkout']);
unset($order_statuses['checkout_shipping']);
unset($order_statuses['checkout_review']);
unset($order_statuses['checkout_payment']);
unset($order_statuses['checkout_complete']);
}
}

No comments:
Post a Comment