Hi,
It seems i am from a logged in customer's point of view unable to create a return on a specific order that has the valid status completed or invoiced.
According the documentation in this module, the link to initiate a return via user/%user/orders/%order/return/add is nowhere shown.
I would have expected it in the customer's orders view as a contextual link, or inside the order details page, but 'nada'.
So i started to write my own custom hook in order to get this RMA on going :
function couture_admin_menu_contextual_links_alter(&$links, $router_item, $root_path) {
// dpm($links, '$links'); dpm($router_item, '$router_item'); dpm($root_path, '$root_path');
if (strpos($root_path, '/orders') === false) {
return;
} else {
$order_id = array_pop($router_item['original_map']);
$order = commerce_order_load($order_id);
if(in_array($order->status, array('completed','invoiced'))) {
$links['commerce-order-add-return'] = array(
'title' => t('Request return'),
'href' => $router_item['href'] . '/return/add',
);
}
} //See more at: http://dominiquedecooman.com/nl/drupal-7-tip-voeg-overal-contextual-links-toe#sthash.F1CgsxzQ.dpuf
}
This solutions works as admin user, but not as authenticated (customer) user.
Checked all my permissions on both return and order actions (see attachments) but nothing here IMHO.
I am able to manually enter the page user/%user/orders/%order/return/add and complete the RMA request.
Am i overlooking something ?
It must be simple though, since no-one has issued it before apparently.
Comment | File | Size | Author |
---|---|---|---|
order-permissions.JPG | 83.79 KB | RAWDESK | |
return-permissions.JPG | 96.34 KB | RAWDESK |
Comments