Woocommerce-admin: Add the ability for 3rd party plugins to declare notices as primary

Created on 10 Sep 2019  路  7Comments  路  Source: woocommerce/woocommerce-admin

Some WooCommerce plugins create notices that are important and WooCommerce Admin is hiding them under the "Notices" inbox.

I know that the whole idea behind this is to keep the backend clean, but we can't just hide all the notices and pretend only the WooCommerce ones are important.

Example:
I got this invoicing plugin that informs the administrator when the invoice was not issued because of some error on the order.

No one sees this if it's hidden under the Notices inbox, and it's important that they do see it:
image

I'm now getting several support tickets from clients stating that there's no feedback on the plugin actions. There is, but they're using WooCommerce Admin and they're not seeing it.

How can a developer create notices that will not be hidden by WooCommerce Admin now, and when it gets merged into core, like the "Order updated" one?

=====

Adding my comment to the OP for visibility - @timmyc

Based off some internal conversations in: p90Yrv-1o6-p2

I'm proposing we implement the following solutions ( /ht and quoting @DanReyLop )

  • The result of shouldCollapseNotice(element) is filterable, so extensions can hook into it and return false their notices.
  • The noticesToHide array is filterable, so extensions can hook into it and add their own css class.
activity panel

All 7 comments

Hi @webdados take a look if this plugin solve your problem: https://wordpress.org/plugins/admin-notices-for-woocommerce/

Hi, don't want a plugin on top of a plugin.

WooCommerce Admin can not hide all notices without giving other WooCommerce extensions the ability to make their important notices visible.

Ok, no problem. But this plugin fix this issue until WooCommerce admin fix this bug.

@webmaniabr thanks for opening up the issue. We have received some similar feedback internally around this too. There is the ability in the code to exclude certain admin alert messages from being placed in the "W" notifications panel, but it currently is not fitlerable.

So thinking we have a few options here:

  • Make that array fitlerable so developers can ensure their alerts are always shown
  • Perhaps we default notices with notice-error classnames to always be visible
  • Explore the notion of turning off the "W" notices menu.

Any thoughts or preferences from your standpoint to those options, or other ideas?

Based off some internal conversations in: p90Yrv-1o6-p2

I'm proposing we implement the following solutions ( /ht and quoting @DanReyLop )

  • The result of shouldCollapseNotice(element) is filterable, so extensions can hook into it and return false their notices.
  • The noticesToHide array is filterable, so extensions can hook into it and add their own css class.

I agree with those solutions.

Of course some people will probably abuse it, but there are valid reasons for some notices to be shown, like my own example above.

Bump @timmyc @jeffstieler - can this go in soon? We need it

cc @LevinMedia @reykjalin

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dechov picture dechov  路  3Comments

timmyc picture timmyc  路  4Comments

LevinMedia picture LevinMedia  路  3Comments

peterfabian picture peterfabian  路  3Comments

mujuonly picture mujuonly  路  3Comments