1

I have created an extension that adds a custom tab in the adminhtml customer interface. After submitting the form on the page, how can I return the user to my custom tab instead of the default tab on customer edit.

This is the code I use to return to the customer edit page in my controller

$redirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$redirect->setUrl($this->_redirect->getRefererUrl());
return $redirect;
  • I am aware of a url piece/param "active_tab", but cannot find an example of how to use it. – Todd May 13 at 16:55
  • In the orders adminhtml tab construct, I can do this: /sales/order/view/order_id/81248/active_tab/order_creditmemos/key/mybigkeystring/ order_creditmemos comes from name of the corresponding tab element, such as: <a href="#sales_order_view_tabs_order_creditmemos_content" id="sales_order_view_tabs_order_creditmemos" name="order_creditmemos" title="Order Credit Memos" .... > However, I have observed that none of the customer tabs have a name property on the link. Is this an oversite or do the customer tabs not conform or perhaps were not fully redeveloped from Magento 1.9x? – Todd May 13 at 17:08
  • I'm seeing now that the entire customer tab widget is one big form that gets saved all together, whereas the order tab widget is not fundamentally a giant form. This probably explains why my plan is not working (even though I am able to submit my own form and take actions and return to the customer edit page, just not the right tab). – Todd May 14 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.