Currently there is no way to remove or alter the button plugins passed to the interface. This implements a hook to alter the gathered ctools plugin array.

CommentFileSizeAuthor
#2 ability_to_alter-2555581-2.patch1.39 KBmglaman

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new1.39 KB

Patch!

wouters_f’s picture

Change to do to your documentation snippet is adding _alter to the alter hook. This will make it actually working.

function hook_commerce_pos_instance_buttons_alter(array &$plugins, CommercePOS $pos) {

For those commands that can not be hidden/erased in this alter hook I used the theme override:

function MYTHEME_link__pos_button(&$variables) {
  if ($variables['path'] == 'admin/commerce/pos/nojs/order_modal') {
     return '';
  }
mglaman’s picture

Status: Needs review » Needs work
+++ b/commerce_pos.api.php
@@ -140,4 +140,19 @@ function hook_commerce_pos_buttons() {
+function hook_commerce_pos_instance_buttons(array &$plugins, CommercePOS $pos) {

Needs to say _alter(

smccabe’s picture

Status: Needs work » Closed (outdated)

Closing as 1.x hasn't been supported for some time. Please use 2.x or preferably 8.x-2.x if possible.