Skip to content

Instantly share code, notes, and snippets.

@tibezh
Created October 11, 2017 08:41
Show Gist options
  • Save tibezh/cfcba4b4970ae57b0eae7fdb54b0a47d to your computer and use it in GitHub Desktop.
Save tibezh/cfcba4b4970ae57b0eae7fdb54b0a47d to your computer and use it in GitHub Desktop.
@init90
Copy link

init90 commented Dec 16, 2020

Open in popup existing action link:

/**
 * Implements HOOK_menu_local_actions_alter().
 */
function MODULE_NAME_menu_local_actions_alter(&$local_actions) {
  if (isset($local_actions['entity.commerce_payment_method.add_form'])) {
    $local_actions['entity.commerce_payment_method.add_form']['options']['attributes']['class'][] = 'use-ajax';
    $local_actions['entity.commerce_payment_method.add_form']['options']['attributes']['data-dialog-type'] = 'modal';
    $local_actions['entity.commerce_payment_method.add_form']['options']['attributes']['data-dialog-options'] = '{"height":"auto","width":"auto"}';
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment